标签:list sort key 范围 card rename members pop san
sortedset:
添加: zadd key score1 member1 score2 member2...
zad mysort 90 laosong 100 zhangsan
获得:zscore key member
zscore mysort laosong
统计成员个数 zcard key
zcard mysort
删除zrem key member1[member2 member3...]
zrem mysort zhangsan
范围查询zrange key start end [withscores]
zrange mysort 0 -1 withscores
从起始位置到结束为按照顺序查找符合条件的元素
zrevrange key start stop [withscores]
zrevange key mysort 0 -1 withscores
set:
添加 sadd key [value1 value2]
sadd myset 1 2 3
获得 smembers key
smembers myset
删除 srem key membres [members1 member2]
srem myset
list:
两端添加 lpush key value1 value2
rpush key value1 value2
获得 lrange key start end
lrange mylist 0 -1
删除 lpop key
rpop key
获得个数 llen key
通用操作keys
查看所有的key: keys *
删除置顶的key: del key
判断key是否存在: exists key
重命名: rename key newkey
查看指定key的类型(结果只有五种类型): type key
标签:list sort key 范围 card rename members pop san
原文地址:http://www.cnblogs.com/f-s-q/p/6158873.html