set key value
get key
del key
mset key1 value1 key2 value2 …
mget key1 key2 …
strlen key
append key value
incr key
incrby key increment
incrbyfloat key increment
decr key
decrby key increment
setex key seconds value
psetex key milliseconds value
hset key field value
hget key field
hgetall key
hdel key field1 [field2]
hmset key field1 value1 field2 value2 …
hmget key field1 field2 …
hlen key
hexists key field
hkeys key
hvals key
hincrby key field increment
hincrbyfloat key field increment
lpush key value1 [value2] …… //lpush 从双向链表左边添加
rpush key value1 [value2] …… //rpush 从双向链表右添加
lrange key start stop // 0 -1 表示从第0个到倒数第一个,即查询所有
lindex key index // 从左边取出第几个索引的数据
llen key
lpop key // 从链表左边取出一个数据并删除链表中的数据
rpop key // 从链表右边取出一个数据并删除链表中的数据
blpop key1 [key2] timeout
brpop key1 [key2] timeout
brpoplpush source destination timeout
lrem key count value // count表示删除几个,value表示被删除的值
sadd key member1 [member2]
smembers key
srem key member1 [member2]
scard key
sismember key member
srandmember key [count]
spop key [count]
sinter key1 [key2]
sunion key1 [key2]
sdiff key1 [key2]
sinterstore destination key1 [key2]
sunionstore destination key1 [key2]
sdiffstore destination key1 [key2]
smove source destination member
zadd key score1 member1 [score2 member2]
zrange key start stop [WITHSCORES] // WITHSCORES显示score值
zrevrange key start stop [WITHSCORES] //反向看
zrem key member [member ...]
zrangebyscore key min max [WITHSCORES] [LIMIT] //limit表示取所查出数据的前多少个数据,类似mysql的limit
zrevrangebyscore key max min [WITHSCORES]
zremrangebyrank key start stop
zremrangebyscore key min max
注意:
zcard key
zcount key min max
zinterstore destination numkeys key [key ...]
zunionstore destination numkeys key [key ...]
zrank key member
zrevrank key member
zscore key member
zincrby key increment member