支持的命令
不同版本的 Redis Standalone 实例对 Redis 命令的支持度有所不同。
注释与说明
为便于阅读和内容表达,本文的表格约定使用下述注释:
-
✓ 表示支持该命令。
-
✕ 表示不支持该命令。
-
⎻ 表示在原生 Redis 的该版本下,该命令尚未开始支持。
-
config 表示支持该命令,但需要在控制台修改控制参数支持。
Connection 命令族
命令 | 5.x 版本 | 6.x 版本 | 7.x 版本 |
---|---|---|---|
AUTH |
✓ |
✓ |
✓ |
CLIENT CACHING |
⎻ |
✓ |
✓ |
CLIENT GETNAME |
✓ |
✓ |
✓ |
CLIENT GETREDIR |
⎻ |
✓ |
✓ |
CLIENT ID |
✓ |
✓ |
✓ |
CLIENT INFO |
⎻ |
⎻ |
✓ |
CLIENT KILL |
✓ |
✓ |
✓ |
CLIENT LIST |
✓ |
✓ |
✓ |
CLIENT NO-EVICT |
⎻ |
⎻ |
✓ |
CLIENT PAUSE |
✓ |
✓ |
✓ |
CLIENT REPLY |
✓ |
✓ |
✓ |
CLIENT SETNAME |
✓ |
✓ |
✓ |
CLIENT TRACKING |
⎻ |
✓ |
✓ |
CLIENT TRACKINGINFO |
⎻ |
⎻ |
✓ |
CLIENT UNBLOCK |
✓ |
✓ |
✓ |
ECHO |
✓ |
✓ |
✓ |
HELLO |
⎻ |
✓ |
✓ |
PING |
✓ |
✓ |
✓ |
QUIT |
✓ |
✓ |
✓ |
RESET |
⎻ |
⎻ |
✓ |
SELECT |
✓ |
✓ |
✓ |
Geo 命令族
命令 | 5.x 版本 | 6.x 版本 | 7.x 版本 |
---|---|---|---|
GEOADD |
✓ |
✓ |
✓ |
GEODIST |
✓ |
✓ |
✓ |
GEOHASH |
✓ |
✓ |
✓ |
GEOPOS |
✓ |
✓ |
✓ |
GEORADIUS |
✓ |
✓ |
✓ |
GEORADIUSBYMEMBER |
✓ |
✓ |
✓ |
GEOSEARCH |
⎻ |
⎻ |
✓ |
GEOSEARCHSTORE |
⎻ |
⎻ |
✓ |
Hashes 命令族
命令 | 5.x 版本 | 6.x 版本 | 7.x 版本 |
---|---|---|---|
HDEL |
✓ |
✓ |
✓ |
HEXISTS |
✓ |
✓ |
✓ |
HGET |
✓ |
✓ |
✓ |
HGETALL |
✓ |
✓ |
✓ |
HINCRBY |
✓ |
✓ |
✓ |
HINCRBYFLOAT |
✓ |
✓ |
✓ |
HKEYS |
✓ |
✓ |
✓ |
HLEN |
✓ |
✓ |
✓ |
HMGET |
✓ |
✓ |
✓ |
HMSET |
✓ |
✓ |
✓ |
HRANDFIELD |
⎻ |
⎻ |
✓ |
HSCAN |
✓ |
✓ |
✓ |
HSET |
✓ |
✓ |
✓ |
HSETNX |
✓ |
✓ |
✓ |
HSTRLEN |
✓ |
✓ |
✓ |
HVALS |
✓ |
✓ |
✓ |
HyperLogLog 命令族
命令 | 5.x 版本 | 6.x 版本 | 7.x 版本 |
---|---|---|---|
PFADD |
✓ |
✓ |
✓ |
PFCOUNT |
✓ |
✓ |
✓ |
PFMERGE |
✓ |
✓ |
✓ |
Keys 命令族
命令 | 5.x 版本 | 6.x 版本 | 7.x 版本 |
---|---|---|---|
COPY |
⎻ |
⎻ |
✓ |
DEL |
✓ |
✓ |
✓ |
DUMP |
✓ |
✓ |
✓ |
EXISTS |
✓ |
✓ |
✓ |
EXPIRE |
✓ |
✓ |
✓ |
EXPIREAT |
✓ |
✓ |
✓ |
KEYS |
config |
config |
config |
MIGRATE |
✓ |
✓ |
✓ |
MOVE |
✓ |
✓ |
✓ |
OBJECT |
✓ |
✓ |
✓ |
OBJECT HELP |
⎻ |
⎻ |
✓ |
PERSIST |
✓ |
✓ |
✓ |
PEXPIRE |
✓ |
✓ |
✓ |
PEXPIREAT |
✓ |
✓ |
✓ |
PEXPIRETIME |
⎻ |
⎻ |
✓ |
PTTL |
✓ |
✓ |
✓ |
RANDOMKEY |
✓ |
✓ |
✓ |
RENAME |
✓ |
✓ |
✓ |
RENAMENX |
✓ |
✓ |
✓ |
RESTORE |
✓ |
✓ |
✓ |
SCAN |
✓ |
✓ |
✓ |
SORT |
✓ |
✓ |
✓ |
SORT_RO |
⎻ |
⎻ |
✓ |
TOUCH |
✓ |
✓ |
✓ |
TTL |
✓ |
✓ |
✓ |
TYPE |
✓ |
✓ |
✓ |
UNLINK |
✓ |
✓ |
✓ |
WAIT |
✓ |
✓ |
✓ |
Lists 命令族
命令 | 5.x 版本 | 6.x 版本 | 7.x 版本 |
---|---|---|---|
BLPOP |
✓ |
✓ |
✓ |
BLMOVE |
⎻ |
⎻ |
✓ |
BLMPOP |
⎻ |
⎻ |
✓ |
BRPOP |
✓ |
✓ |
✓ |
BRPOPLPUSH |
✓ |
✓ |
✓ |
LINDEX |
✓ |
✓ |
✓ |
LINSERT |
✓ |
✓ |
✓ |
LLEN |
✓ |
✓ |
✓ |
LMOVE |
⎻ |
⎻ |
✓ |
LMPOP |
⎻ |
⎻ |
✓ |
LPOP |
✓ |
✓ |
✓ |
LPUSH |
✓ |
✓ |
✓ |
LPUSHX |
✓ |
✓ |
✓ |
LRANGE |
✓ |
✓ |
✓ |
LREM |
✓ |
✓ |
✓ |
LSET |
✓ |
✓ |
✓ |
LTRIM |
✓ |
✓ |
✓ |
RPOP |
✓ |
✓ |
✓ |
RPOPLPUSH |
✓ |
✓ |
✓ |
RPUSH |
✓ |
✓ |
✓ |
RPUSHX |
✓ |
✓ |
✓ |
Pub 和 Sub 命令族
命令 | 5.x 版本 | 6.x 版本 | 7.x 版本 |
---|---|---|---|
PSUBSCRIBE |
✓ |
✓ |
✓ |
PUBLISH |
✓ |
✓ |
✓ |
PUBSUB |
✓ |
✓ |
✓ |
PUBSUB HELP |
⎻ |
⎻ |
✓ |
PUBSUB SHARDCHANNELS |
⎻ |
⎻ |
✓ |
PUBSUB SHARDNUMSUB |
⎻ |
⎻ |
✓ |
PUNSUBSCRIBE |
✓ |
✓ |
✓ |
SPUBLISH |
⎻ |
⎻ |
✓ |
SUBSCRIBE |
✓ |
✓ |
✓ |
SSUBSCRIBE |
⎻ |
⎻ |
✓ |
SUNSUBSCRIBE |
⎻ |
⎻ |
✓ |
UNSUBSCRIBE |
✓ |
✓ |
✓ |
Scripting 命令族
命令 | 5.x 版本 | 6.x 版本 | 7.x 版本 |
---|---|---|---|
EVAL |
✓ |
✓ |
✓ |
EVAL_RO |
⎻ |
⎻ |
✓ |
EVALSHA |
✓ |
✓ |
✓ |
EVALSHA_RO |
⎻ |
⎻ |
✓ |
FCALL |
⎻ |
⎻ |
✓ |
FCALL_RO |
⎻ |
⎻ |
✓ |
FUNCTION DELETE |
⎻ |
⎻ |
✓ |
FUNCTION DUMP |
⎻ |
⎻ |
✓ |
FUNCTION FLUSH |
⎻ |
⎻ |
✓ |
FUNCTION HELP |
⎻ |
⎻ |
✓ |
FUNCTION KILL |
⎻ |
⎻ |
✓ |
FUNCTION LIST |
⎻ |
⎻ |
✓ |
FUNCTION LOAD |
⎻ |
⎻ |
✓ |
FUNCTION RESTORE |
⎻ |
⎻ |
✓ |
FUNCTION STATS |
⎻ |
⎻ |
✓ |
SCRIPT DEBUG |
✓ |
✓ |
✓ |
SCRIPT EXISTS |
✓ |
✓ |
✓ |
SCRIPT FLUSH |
✓ |
✓ |
✓ |
SCRIPT KILL |
✓ |
✓ |
✓ |
SCRIPT LOAD |
✓ |
✓ |
✓ |
Sentinel 命令族
命令 | 5.x 版本 | 6.x 版本 | 7.x 版本 |
---|---|---|---|
SENTINEL sentinels |
✓ |
✓ |
✓ |
SENTINEL get-master-addr-by-name |
✓ |
✓ |
✓ |
Server 命令族
注意 |
---|
Redis 6.x 版本屏蔽了 ACL 命令,但 AppCenter 控制台已经实现了 ACL 访问控制功能。 |
命令 | 5.x 版本 | 6.x 版本 | 7.x 版本 |
---|---|---|---|
ACL CAT |
⎻ |
config |
config |
ACL DELUSER |
⎻ |
config |
config |
ACL GENPASS |
⎻ |
config |
config |
ACL GETUSER |
⎻ |
config |
config |
ACL HELP |
⎻ |
config |
config |
ACL LIST |
⎻ |
config |
config |
ACL LOAD |
⎻ |
config |
config |
ACL LOG |
⎻ |
config |
config |
ACL SAVE |
⎻ |
config |
config |
ACL SETUSER |
⎻ |
config |
config |
ACL USERS |
⎻ |
config |
config |
ACL WHOAMI |
⎻ |
config |
config |
BGREWRITEAOF |
config |
config |
config |
BGSAVE |
config |
config |
config |
COMMAND |
✓ |
✓ |
✓ |
COMMAND COUNT |
✓ |
✓ |
✓ |
COMMAND GETKEYS |
✓ |
✓ |
✓ |
COMMAND INFO |
✓ |
✓ |
✓ |
CONFIG GET |
config |
config |
config |
CONFIG RESETSTAT |
config |
config |
config |
CONFIG REWRITE |
config |
config |
config |
CONFIG SET |
config |
config |
config |
DBSIZE |
✓ |
✓ |
✓ |
DEBUG OBJECT |
config |
config |
config |
DEBUG SEGFAULT |
config |
config |
config |
FLUSHALL |
config |
config |
config |
FLUSHDB |
config |
config |
config |
INFO |
✓ |
✓ |
✓ |
LASTSAVE |
✓ |
✓ |
✓ |
LATENCY DOCTOR |
✓ |
✓ |
✓ |
LATENCY GRAPH |
✓ |
✓ |
✓ |
LATENCY HELP |
✓ |
✓ |
✓ |
LATENCY HISTORY |
✓ |
✓ |
✓ |
LATENCY LATEST |
✓ |
✓ |
✓ |
LATENCY RESET |
✓ |
✓ |
✓ |
LOLWUT |
✓ |
✓ |
✓ |
MEMORY DOCTOR |
✓ |
✓ |
✓ |
MEMORY HELP |
✓ |
✓ |
✓ |
MEMORY MALLOC-STATS |
✓ |
✓ |
✓ |
MEMORY PURGE |
✓ |
✓ |
✓ |
MEMORY STATS |
✓ |
✓ |
✓ |
MEMORY USAGE |
✓ |
✓ |
✓ |
MODULE LIST |
✓ |
✓ |
✓ |
MODULE LOAD |
✓ |
✓ |
✓ |
MODULE UNLOAD |
✓ |
✓ |
✓ |
MONITOR |
✓ |
✓ |
✓ |
PSYNC |
✓ |
✓ |
✓ |
REPLICAOF |
config |
config |
config |
ROLE |
✓ |
✓ |
✓ |
SAVE |
config |
config |
config |
SHUTDOWN |
config |
config |
config |
SLAVEOF |
config |
config |
config |
SLOWLOG |
✓ |
✓ |
✓ |
SWAPDB |
✓ |
✓ |
✓ |
SYNC |
✓ |
✓ |
✓ |
TIME |
✓ |
✓ |
✓ |
Sets 命令族
命令 | 5.x 版本 | 6.x 版本 | 7.x 版本 |
---|---|---|---|
SADD |
✓ |
✓ |
✓ |
SCARD |
✓ |
✓ |
✓ |
SDIFF |
✓ |
✓ |
✓ |
SDIFFSTORE |
✓ |
✓ |
✓ |
SINTER |
✓ |
✓ |
✓ |
SINTERCORD |
⎻ |
⎻ |
✓ |
SINTERSTORE |
✓ |
✓ |
✓ |
SISMEMBER |
✓ |
✓ |
✓ |
SMEMBERS |
✓ |
✓ |
✓ |
SMISMEMBER |
✓ |
✓ |
✓ |
SMOVE |
✓ |
✓ |
✓ |
SPOP |
✓ |
✓ |
✓ |
SRANDMEMBER |
✓ |
✓ |
✓ |
SREM |
✓ |
✓ |
✓ |
SSCAN |
✓ |
✓ |
✓ |
SUNION |
✓ |
✓ |
✓ |
SUNIONSTORE |
✓ |
✓ |
✓ |
Sorted Sets 命令族
命令 | 5.x 版本 | 6.x 版本 | 7.x 版本 |
---|---|---|---|
BZMPOP |
⎻ |
⎻ |
✓ |
BZPOPMAX |
✓ |
✓ |
✓ |
BZPOPMIN |
✓ |
✓ |
✓ |
ZADD |
✓ |
✓ |
✓ |
ZCARD |
✓ |
✓ |
✓ |
ZCOUNT |
✓ |
✓ |
✓ |
ZDIFF |
⎻ |
⎻ |
✓ |
ZDIFFSTORE |
⎻ |
⎻ |
✓ |
ZINCRBY |
✓ |
✓ |
✓ |
ZINTER |
⎻ |
⎻ |
✓ |
ZINTERCARD |
⎻ |
⎻ |
✓ |
ZINTERSTORE |
✓ |
✓ |
✓ |
ZLEXCOUNT |
✓ |
✓ |
✓ |
ZMPOP |
⎻ |
⎻ |
✓ |
ZMSCORE |
⎻ |
⎻ |
✓ |
ZPOPMAX |
✓ |
✓ |
✓ |
ZPOPMIN |
✓ |
✓ |
✓ |
ZRANDMEMBER |
⎻ |
⎻ |
✓ |
ZRANGE |
✓ |
✓ |
✓ |
ZRANGEBYLEX |
✓ |
✓ |
✓ |
ZRANGEBYSCORE |
✓ |
✓ |
✓ |
ZRANGESTORE |
⎻ |
⎻ |
✓ |
ZRANK |
✓ |
✓ |
✓ |
ZREM |
✓ |
✓ |
✓ |
ZREMRANGEBYLEX |
✓ |
✓ |
✓ |
ZREMRANGEBYRANK |
✓ |
✓ |
✓ |
ZREMRANGEBYSCORE |
✓ |
✓ |
✓ |
ZREVRANGE |
✓ |
✓ |
✓ |
ZREVRANGEBYLEX |
✓ |
✓ |
✓ |
ZREVRANGEBYSCORE |
✓ |
✓ |
✓ |
ZREVRANK |
✓ |
✓ |
✓ |
ZSCAN |
✓ |
✓ |
✓ |
ZSCORE |
✓ |
✓ |
✓ |
ZUNION |
⎻ |
⎻ |
✓ |
ZUNIONSTORE |
✓ |
✓ |
✓ |
Streams 命令族
命令 | 5.x 版本 | 6.x 版本 | 7.x 版本 |
---|---|---|---|
XACK |
✓ |
✓ |
✓ |
XADD |
✓ |
✓ |
✓ |
XAUTOCLAIM |
⎻ |
⎻ |
✓ |
XCLAIM |
✓ |
✓ |
✓ |
XDEL |
✓ |
✓ |
✓ |
XGROUP |
✓ |
✓ |
✓ |
XGROUP CREATECONSUMER |
⎻ |
⎻ |
✓ |
XINFO |
✓ |
✓ |
✓ |
XLEN |
✓ |
✓ |
✓ |
XPENDING |
✓ |
✓ |
✓ |
XRANGE |
✓ |
✓ |
✓ |
XREAD |
✓ |
✓ |
✓ |
XREADGROUP |
✓ |
✓ |
✓ |
XREVRANGE |
✓ |
✓ |
✓ |
XTRIM |
✓ |
✓ |
✓ |
Strings 命令族
命令 | 5.x 版本 | 6.x 版本 | 7.x 版本 |
---|---|---|---|
APPEND |
✓ |
✓ |
✓ |
BITCOUNT |
✓ |
✓ |
✓ |
BITFIELD |
✓ |
✓ |
✓ |
BITOP |
✓ |
✓ |
✓ |
BITPOS |
✓ |
✓ |
✓ |
DECR |
✓ |
✓ |
✓ |
DECRBY |
✓ |
✓ |
✓ |
GET |
✓ |
✓ |
✓ |
GETDEL |
⎻ |
⎻ |
✓ |
GETEX |
⎻ |
⎻ |
✓ |
GETBIT |
✓ |
✓ |
✓ |
GETRANGE |
✓ |
✓ |
✓ |
GETSET |
✓ |
✓ |
✓ |
LCS |
⎻ |
⎻ |
✓ |
INCR |
✓ |
✓ |
✓ |
INCRBY |
✓ |
✓ |
✓ |
INCRBYFLOAT |
✓ |
✓ |
✓ |
MGET |
✓ |
✓ |
✓ |
MSET |
✓ |
✓ |
✓ |
MSETNX |
✓ |
✓ |
✓ |
PSETEX |
✓ |
✓ |
✓ |
SET |
✓ |
✓ |
✓ |
SETBIT |
✓ |
✓ |
✓ |
SETEX |
✓ |
✓ |
✓ |
SETNX |
✓ |
✓ |
✓ |
SETRANGE |
✓ |
✓ |
✓ |
STRALGO |
- |
✓ |
- |
STRLEN |
✓ |
✓ |
✓ |
Transaction 命令族
命令 | 5.x 版本 | 6.x 版本 | 7.x 版本 |
---|---|---|---|
DISCARD |
✓ |
✓ |
✓ |
EXEC |
✓ |
✓ |
✓ |
MULTI |
✓ |
✓ |
✓ |
UNWATCH |
✓ |
✓ |
✓ |
WATCH |
✓ |
✓ |
✓ |