五种数据类型
string:基本
hash:存储对象(hset key field value)
list:关注列表,粉丝列表(lpush key value1 [value2] … ;lpop key)
lrem key count value //count为移除的数量,value为移除哪个值
set:共同好友,集合交并差,去重统计网站uv(sadd key menber1 [member2])
sinter key1 [key2] //交集
sunion key1 [key2] //并集
sorted set(zset):排行榜,需要排序的地方,最新评论需要翻页
zadd key score1 member1 [score2 member2]
zrank key member //正数第几位
//查询scores在某个范围内的值
zrange key min max // min到max之间的从小到大排列
zocunt key min max //统计key位于min和max之间的数量
zrangebyscore key min max [WITHSCORES] [LIMIT]
zrem key 元素
zincrby key score 元素( zincrby student 20 Tom,给Tom加20分)
bitmap
setbit a 2 1(将ke