标签:图片 set 分享 判断 cond 结构 3.3 数据结构 ted
如果设置的键不存在则为添加,如果设置的键已经存在则为修改
set key value
设置键为name值为java的数据
setex aa 3 aa
mset key1 value1 key2 value2 ....
append key value
get key
mget key1 key2 ...
keys pattern
exists key1
type key
del key1 key2 ...
expire key seconds
expire ‘a1‘ 3
ttl key
hset key field value
hset u2 name tom age 11
hkeys key
hget key field
获取多个属性的值
hget key field1 field2...
hvals key
hdel key1 field1 field2
例7:删除键‘u2‘的属性‘age’
hdel u2 age
lpush key value1 value2
rpush key value1 value2 ...
linsert key before 或 after 现有元素 新元素
lrange key start stop
lrange a1 0 -1
lset key index value
lrem key count value
sadd key member1 member2
smember a3
srem key
zadd key score1 member1 score2 member2 ...
zadd a4 4 jing 5 eva 6 jin
zrange key start stop
zrangebyscore key min max
zscore key member
zrem key member1member2
zremrangebyscore key min max
标签:图片 set 分享 判断 cond 结构 3.3 数据结构 ted
原文地址:https://www.cnblogs.com/shine-rainbow/p/9825916.html