标签:解决方案 hang size 没有 hash ttl field hat 注意
====================
=================
查看所有的key
可以使用KEYS 命令
KEYS pattern
例如,列出所有的key
redis> keys *
列出匹配的key
redis>keys apple*
1) apple1
2) apple2
================
set key value
set name itcast
setex key seconds value
setex aa 3 aa
mset key1 value1 key2 value2 ...
mset a1 python a2 java a3 c
append key value
append ‘a1‘ ‘haha‘
get key
get ‘name‘
mget key1 key2 ...
mget a1 a2 a3
type key
type a1
del key1 key2 ...
del a2 a3
expire key seconds
expire ‘a1‘ 3
查看有效时间,以秒为单位
ttl key
=========================
hset key field value
hset user name itheima
MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist on disk. Commands that may modify the data set are disabled. Please check Redis logs for details about the error.
Redis被配置为保存数据库快照,但它目前不能持久化到硬盘。用来修改集合数据的命令不能用
原因:
hmset key field1 value1 field2 value2 ...
hmset u2 name itcast age 11
hkeys key
hkeys u2
hget key field
hget u2 ‘name‘
hmget key field1 field2 ...
hmget u2 name age
hvals key
hvals u2
hdel key field1 field2 ...
hdel u2 age
==============================
lpush key value1 value2 ...
lpush a1 a b c
rpush key value1 value2 ...
rpush a1 0 1
linsert key before或after 现有元素 新元素
linsert a1 before b 3
lrange key start stop
lrange a1 0 -1
lset key index value
lset a 1 z
lrem key count value
lpush a2 a b a b a b
lrem a2 -2 b
lrange a2 0 -1
===============================
sadd key member1 member2 ...
sadd a3 zhangsan sili wangwu
smembers key
smembers a3
srem key
srem a3 wangwu
=============================
zadd key score1 member1 score2 member2 ...
zadd a4 4 lisi 5 wangwu 6 zhaoliu 3 zhangsan
zrange key start stop
zrange a4 0 -1
zrangebyscore key min max
zrangebyscore a4 5 6
zscore key member
zscore a4 zhangsan
zrem key member1 member2 ...
zrem a4 zhangsan
zremrangebyscore key min max
zremrangebyscore a4 5 6
from:https://www.cnblogs.com/sunzhiqi/p/10869638.html
标签:解决方案 hang size 没有 hash ttl field hat 注意
原文地址:https://www.cnblogs.com/anenyang/p/12320849.html