字符串:
setnx: 若没有则设置
setex: setex key exit_time value [设置其删除时间]
setrange: setrange key index replace_value [依据index对字符串进行替换]
mset: multi_set key1 value1 key2 value2 ...
mget: key1 key2 key3
getrange: getrange key startindex endindex [均是闭区间]
append: append key value [追加到末尾字符串]
列表:
lpush: 从左边添加
rpush: 从右边添加
lpop: 左边删除
rpop: 右边删除
lrange: lrange key start end [0 -1 全部获取]
lrem: lrem key count value [count >0 从左边删除 count<0 右边 count = 删除全部]
哈希表:
hincrby: hincrby table_name col_name col_value [增加 键和值 ]
hvals: hvals table_name [获取哈希表的value]
hkeys: hkeys table_name [获取哈希表的key]
集合:
sadd: add set_name value
smembers: smembres set_name [查询所有的值]
sdiff: sdiff friend01 friend02 [对于后者不同的 差集 a-b]
sinter: sinter friend01 friend02 [两个集合中相同部分 交集 ∩]
sunion: sunion friend01 friend02 [取两个集合的并集 ∪ ]
scard: scard friend01 [查看friend01里面的元素值]
srandmember: srandmenber friend01 [随机获取某一个值]
spop: spop fried01 [从集合中弹出]
有序集合:
zadd: zadd score_top 0 zhangsan [增加集合数据]
zscore: zscore score_top zhangsan
zrange: zrange score_top start stop [依据数值从小到大排序, 选取index]
zrangebyscore: zrangebyscore score_top min max [limit offset count]
zcount: zcount key min max [获取指定元素内]
zremrangebyrank: zremrangebyrank score_top start_index end_index [按照排名范围删除]
zremrangebyscore: zremrangebyscore key min max [按照分数范围删除元素]
zrank: zrank score_top zhangsan [获取元素排名 返回index]