通用API
del key
expire key num
exists key
字符串对象
set key value
get key
mset key1 value1 key2 value2 key3 value3
mget key1 key2 key3
setex key num value
setnx key value
incr key
incrby key num
列表对象
lpush key value1 value2 value3
rpush key value1 value2 value3
lpop key
rpop key
lindex key num
llen key
lrange key start_index end_index
ltrim key start_index end_index
哈希对象
hset key hashkey value
hget key hashkey
hmset key hashkey1 value1 hashkey2 value2 hashkey3 value3
hlen key
hgetall key
hincrby key hashkey num
集合对象
sadd key value1 value2
scard key
smembers key
sismember key value
spop key
有序集合对象
zadd key score value
zrem key value
zcard key
zrange key start_index end_index
zrevrange key start_index end_index
zscore key value
zrank key value
zrangebyscore key start_score end_score