Redis: How to access keys in a specific key space

I have 2 key spaces on my redis server:

db0:keys=1,expires=0 db1:keys=36679593,expires=0 

But if I run

 redis-cli KEYS '*' 

I only get keys in db0. How can I search for keys in db1?

+4
source share
1 answer

You can use redis-cli with the -n option;

 $ redis-cli -n 1 KEYS '*' $ redis-cli --help redis-cli 2.6.7 Usage: redis-cli [OPTIONS] [cmd [arg [arg ...]]] ... -n <db> Database number ... 
+7
source

Source: https://habr.com/ru/post/1481426/


All Articles