redis 常用

有序集合

方法多以z开头

获取所有key的所有列表

zrange key 0 -1

Hash(哈希)集合

删除指定的hash field

hdel key field

返回指定hsah的field数量

hlen key

返回hash的所有field

hkeys key

返回hash的所有value

hvals key

返回hsah的所有field和value

hgetall key

hkey是否存在

hexists key hkey

技巧