String - 字符串类型
Hash - Hash类型
List - 列表类型
Set - 集合类型
Zset - 有序集合类型

字符串命令


Hash类型用于存储结构化数据

Hash命令


List列表就是一系列字符串的“数组”,按插入顺序排序。
List列表最大长度为2的32次方-1,可以包含40亿个元素。
List命令
rpush listkey c b a - 右侧插入
lpush listkey f e d - 左侧插入

rpop listkey - 右侧弹出

lpop listkey - 左侧弹出

lrange listkey 0 -1 - 列出listkey中从开始到末尾所有元素

Set集合是字符串的无序集合,集合成员是唯一的。
Zset集合是字符串的有序集合,集合成员是唯一的。

sinter set1 set2 - 交集
sunion set1 set2 - 并集
sdiff set1 set2 - 差集



