命令兼容性

最近更新时间: 2024-10-17 17:10:00

各版本命令兼容性说明如下表:

命令族 命令 4.0标准版 4.0集群版 5.0标准版 5.0集群版 集群版跨 Slot 支持

connection 族
auth -
echo -
ping -
quit -
select -
swapdb x x -

hash 族
hdel -
hexists -
hget
-
hgetall -
hincrby -
hincrbyfloat -
hkeys -
hlen -
hmget -
hmset >
-
hset -
hsetnx -
hstrlen -
hvals -
hscan -
touch -
restore -
object -
unlink x
wait x x -
migrate x x x x -
dump -
del
scan -
exists
expire -
expireat -
keys -
type -
move -
ttl -
persist -
pexpire -
pexpireat -
pttl -
randomkey -
rename x
renamenx x
sort -

list 族
lindex -
linsert -
llen -
lpop -
lpush -
lpushx -
lrange -
lrem -
lset -
ltrim -
rpop -
rpoplpush x
rpush -
rpushx -
blpop x
brpop x
brpoplpush x

pub/sub 族
psubscribe -
pubsub -
publish -
punsubscribe -
subscribe -
unsubscribe -

sets 族
sadd -
scard -
sdiff x
sdiffstore x
sinter x
sinterstore x
sismember -
smembers -
smove x
spop -
srandmember -
srem -
sscan -
sunion x
sunionstore x

sorted sets 族
zadd -
zcard -
zcount -
zincrby -
zinterstore x
zlexcount -
zrange -
zrangebylex -
zrangebyscore -
zrank -
zrem -
zremrangebylex -
zremrangebyrank -
zremrangebyscore -
zrevrange -
zrevrangebylex -
zrevrangebyscore -
zscore -
zrevrank -
zscan -
zunionstore x

zpopmax
x x -

zpopmin
x x -

bzpopmax
x x -

bzpopmin
x x -

strings 族
append -
bitcount -
bitop x
bitpos -
decr -
decrby -
get -
getbit -
getrange -
getset -
incr -
incrby -
incrbyfloat -
mget
mset
msetnx x
psetex -
setex -
set -
setbit -
setnx -
setrange -
strlen -
bitfield -

transactions 族
discard -
exec -
multi -
unwatch -
watch -

hyperloglog 族
pfadd -
pfcount x
pfmerge x

scripting 族
eval x
evalsha x
script debug -
script exists x
script flush -
script load -
script kill -

geo 族
geoadd -
geohash -
geopos -
geodist -
georadius -
georadiusbymember -

server 族
bgrewriteaof x x x x -
bgsave x x x x -
client kill x x x x -
sync x x x x -
psync x x x x -
client list -
client getname -
client pause x x x x -
client reply x x x x -
client setname -
command count -
command getkeys -
command info -
slaveof x x x x -
config rewrite







-
config set x x x x -
config resetstat







-
debug object x x x x -
debug segfault x x x x -
role -
save x x x x -
lastsave -
shutdown x x x x -
MEMORY x x -
command -
dbsize -
info -
time -
config get -
monitor -
flushdb -
flushall -
slowlog x x -
cluster keyslot x x -
cluster nodes x x -
cluster getkeysinslot x x -
cluster slots x x -
cluster info x x -
cluster countkeysinslot x x -
cluster 其他 x x x x -
module x x x x -
lolwut x x -

Stream 族
xinfo x x -
xadd x x -
xtrim x x -
xdel x x -
xrange x x -
xrevrange x x -
xlen x x -
xread x x x
xgroup x x -
xreadgroup x x x
xack x x -
xclaim x x -
xpending x x -