Redis命令行查询缓存值

 

一、连接Redis服务器

redis-cli -h host -p port -a password

 

二、查询所有的keys

keys *

Redis命令行查询缓存值

 

 

三、获取指定的key对应的值

1)查询key对应的value 

type <key>

2)不同的type,查询的命令不一样

if value is of type string -> GET <key>
if value is of type hash -> HGETALL <key>
if value is of type lists -> lrange <key> <start> <end>
if value is of type sets -> smembers <key>
if value is of type sorted sets -> ZRANGEBYSCORE <key> <min> <max>

 

上一篇:不支持原子性的Redis事务能不能叫事务吗?


下一篇:for/in 循环遍历对象的属性