shawncat
1/9/2020 - 10:57 AM

Redis

base

redis-server /usr/local/etc/redis.conf

redis-cli
redis-cli -h host -p port -a password
redis-cli KEYS “edu:*” | xargs redis-cli DEL

//删除当前数据库中的所有Key  
flushdb  
//删除所有数据库中的key  
flushall 

config

daemonize yes
requirepass 123456

data

set key value
get key
del key

lpush key value
rpush key value
lpop key value
rpop key value
lrange key start stop
lindex key index

sadd key value
srem key value
smembers key
sismember key value

hset hashkey subkey value
hgetall hashkey
hget hashkey subkey
hdel hashkey subkey

zadd key score value
zrem key value
zrange key start stop
zrangebyscore key score1 score2