Redis command to get all available keys?

后端 未结 15 2691
攒了一身酷
攒了一身酷 2020-12-04 04:30

Is there a Redis command for fetching all keys in the database? I have seen some python-redis libraries fetching them. But was wondering if it is possible from redis-client.

15条回答
  •  北荒
    北荒 (楼主)
    2020-12-04 05:06

    Yes, you can get all keys by using this

    var redis = require('redis');
    redisClient = redis.createClient(redis.port, redis.host);    
      redisClient.keys('*example*', function (err, keys) {
    })
    

提交回复
热议问题