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.
Redis command to get all available keys
redisredis-cliredis-commands
redisredis-cliredis-commands
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.
Best Answer
Try to look at
KEYS
command.KEYS *
will list all keys stored in redis.EDIT: please note the warning at the top of
KEYS
documentation page:UPDATE (V2.8 or greater):
SCAN
is a superior alternative toKEYS
, in the sense that it does not block the server nor does it consume significant resources. Prefer using it.