Redis Command Reference
Search every Redis 7.2 command with syntax, complexity and since-version, and build common commands for redis-cli — entirely on this device.
All 392 commands shown
Share links carry only the search text and group choice.
20 common patterns — each writes one line for redis-cli. Nothing is executed and nothing you type leaves this device.
Pick a pattern above — the exact redis-cli line builds here as you type, and copies in one press.
392 commands · 17 groups
| Command | Syntax | Since | Complexity |
|---|---|---|---|
APPEND | APPEND key value | 2.0.0 | O(1). The amortized time complexity is O(1) assuming the appended value is small and the already present value is of any size, since the dynamic string library used by Redis will double the free space available on every reallocation. |
DECR | DECR key | 1.0.0 | O(1) |
DECRBY | DECRBY key decrement | 1.0.0 | O(1) |
GET | GET key | 1.0.0 | O(1) |
GETDEL | GETDEL key | 6.2.0 | O(1) |
GETEX | GETEX key [EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | PERSIST] | 6.2.0 | O(1) |
GETRANGE | GETRANGE key start end | 2.4.0 | O(N) where N is the length of the returned string. The complexity is ultimately determined by the returned length, but because creating a substring from an existing string is very cheap, it can be considered O(1) for small strings. |
GETSETDeprecated since 6.2.0Use instead: SET with the GET argument | GETSET key value | 1.0.0 | O(1) |
INCR | INCR key | 1.0.0 | O(1) |
INCRBY | INCRBY key increment | 1.0.0 | O(1) |
INCRBYFLOAT | INCRBYFLOAT key increment | 2.6.0 | O(1) |
LCS | LCS key1 key2 [LEN] [IDX] [MINMATCHLEN min-match-len] [WITHMATCHLEN] | 7.0.0 | O(N*M) where N and M are the lengths of s1 and s2, respectively |
MGET | MGET key [key ...] | 1.0.0 | O(N) where N is the number of keys to retrieve. |
MSET | MSET key value [key value ...] | 1.0.1 | O(N) where N is the number of keys to set. |
MSETNX | MSETNX key value [key value ...] | 1.0.1 | O(N) where N is the number of keys to set. |
PSETEXDeprecated since 2.6.12Use instead: SET with the PX argument | PSETEX key milliseconds value | 2.6.0 | O(1) |
SET | SET key value [NX | XX] [GET] [EX seconds | PX milliseconds | EXAT unix-time-seconds | PXAT unix-time-milliseconds | KEEPTTL] | 1.0.0 | O(1) |
SETEXDeprecated since 2.6.12Use instead: SET with the EX argument | SETEX key seconds value | 2.0.0 | O(1) |
SETNXDeprecated since 2.6.12Use instead: SET with the NX argument | SETNX key value | 1.0.0 | O(1) |
SETRANGE | SETRANGE key offset value | 2.2.0 | O(1), not counting the time taken to copy the new string in place. Usually, this string is very small so the amortized complexity is O(1). Otherwise, complexity is O(M) with M being the length of the value argument. |
STRLEN | STRLEN key | 2.2.0 | O(1) |
SUBSTRDeprecated since 2.0.0Use instead: GETRANGE | SUBSTR key start end | 1.0.0 | O(N) where N is the length of the returned string. The complexity is ultimately determined by the returned length, but because creating a substring from an existing string is very cheap, it can be considered O(1) for small strings. |
| Command | Syntax | Since | Complexity |
|---|---|---|---|
BLMOVE | BLMOVE source destination <LEFT | RIGHT> <LEFT | RIGHT> timeout | 6.2.0 | O(1) |
BLMPOP | BLMPOP timeout numkeys key [key ...] <LEFT | RIGHT> [COUNT count] | 7.0.0 | O(N+M) where N is the number of provided keys and M is the number of elements returned. |
BLPOP | BLPOP key [key ...] timeout | 2.0.0 | O(N) where N is the number of provided keys. |
BRPOP | BRPOP key [key ...] timeout | 2.0.0 | O(N) where N is the number of provided keys. |
BRPOPLPUSHDeprecated since 6.2.0Use instead: BLMOVE with the RIGHT and LEFT arguments | BRPOPLPUSH source destination timeout | 2.2.0 | O(1) |
LINDEX | LINDEX key index | 1.0.0 | O(N) where N is the number of elements to traverse to get to the element at index. This makes asking for the first or the last element of the list O(1). |
LINSERT | LINSERT key <BEFORE | AFTER> pivot element | 2.2.0 | O(N) where N is the number of elements to traverse before seeing the value pivot. This means that inserting somewhere on the left end on the list (head) can be considered O(1) and inserting somewhere on the right end (tail) is O(N). |
LLEN | LLEN key | 1.0.0 | O(1) |
LMOVE | LMOVE source destination <LEFT | RIGHT> <LEFT | RIGHT> | 6.2.0 | O(1) |
LMPOP | LMPOP numkeys key [key ...] <LEFT | RIGHT> [COUNT count] | 7.0.0 | O(N+M) where N is the number of provided keys and M is the number of elements returned. |
LPOP | LPOP key [count] | 1.0.0 | O(N) where N is the number of elements returned |
LPOS | LPOS key element [RANK rank] [COUNT num-matches] [MAXLEN len] | 6.0.6 | O(N) where N is the number of elements in the list, for the average case. When searching for elements near the head or the tail of the list, or when the MAXLEN option is provided, the command may run in constant time. |
LPUSH | LPUSH key element [element ...] | 1.0.0 | O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments. |
LPUSHX | LPUSHX key element [element ...] | 2.2.0 | O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments. |
LRANGE | LRANGE key start stop | 1.0.0 | O(S+N) where S is the distance of start offset from HEAD for small lists, from nearest end (HEAD or TAIL) for large lists; and N is the number of elements in the specified range. |
LREM | LREM key count element | 1.0.0 | O(N+M) where N is the length of the list and M is the number of elements removed. |
LSET | LSET key index element | 1.0.0 | O(N) where N is the length of the list. Setting either the first or the last element of the list is O(1). |
LTRIM | LTRIM key start stop | 1.0.0 | O(N) where N is the number of elements to be removed by the operation. |
RPOP | RPOP key [count] | 1.0.0 | O(N) where N is the number of elements returned |
RPOPLPUSHDeprecated since 6.2.0Use instead: LMOVE with the RIGHT and LEFT arguments | RPOPLPUSH source destination | 1.2.0 | O(1) |
RPUSH | RPUSH key element [element ...] | 1.0.0 | O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments. |
RPUSHX | RPUSHX key element [element ...] | 2.2.0 | O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments. |
| Command | Syntax | Since | Complexity |
|---|---|---|---|
HDEL | HDEL key field [field ...] | 2.0.0 | O(N) where N is the number of fields to be removed. |
HEXISTS | HEXISTS key field | 2.0.0 | O(1) |
HGET | HGET key field | 2.0.0 | O(1) |
HGETALL | HGETALL key | 2.0.0 | O(N) where N is the size of the hash. |
HINCRBY | HINCRBY key field increment | 2.0.0 | O(1) |
HINCRBYFLOAT | HINCRBYFLOAT key field increment | 2.6.0 | O(1) |
HKEYS | HKEYS key | 2.0.0 | O(N) where N is the size of the hash. |
HLEN | HLEN key | 2.0.0 | O(1) |
HMGET | HMGET key field [field ...] | 2.0.0 | O(N) where N is the number of fields being requested. |
HMSETDeprecated since 4.0.0Use instead: HSET with multiple field-value pairs | HMSET key field value [field value ...] | 2.0.0 | O(N) where N is the number of fields being set. |
HRANDFIELD | HRANDFIELD key [count [WITHVALUES]] | 6.2.0 | O(N) where N is the number of fields returned |
HSCAN | HSCAN key cursor [MATCH pattern] [COUNT count] | 2.8.0 | O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection. |
HSET | HSET key field value [field value ...] | 2.0.0 | O(1) for each field/value pair added, so O(N) to add N field/value pairs when the command is called with multiple field/value pairs. |
HSETNX | HSETNX key field value | 2.0.0 | O(1) |
HSTRLEN | HSTRLEN key field | 3.2.0 | O(1) |
HVALS | HVALS key | 2.0.0 | O(N) where N is the size of the hash. |
| Command | Syntax | Since | Complexity |
|---|---|---|---|
SADD | SADD key member [member ...] | 1.0.0 | O(1) for each element added, so O(N) to add N elements when the command is called with multiple arguments. |
SCARD | SCARD key | 1.0.0 | O(1) |
SDIFF | SDIFF key [key ...] | 1.0.0 | O(N) where N is the total number of elements in all given sets. |
SDIFFSTORE | SDIFFSTORE destination key [key ...] | 1.0.0 | O(N) where N is the total number of elements in all given sets. |
SINTER | SINTER key [key ...] | 1.0.0 | O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets. |
SINTERCARD | SINTERCARD numkeys key [key ...] [LIMIT limit] | 7.0.0 | O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets. |
SINTERSTORE | SINTERSTORE destination key [key ...] | 1.0.0 | O(N*M) worst case where N is the cardinality of the smallest set and M is the number of sets. |
SISMEMBER | SISMEMBER key member | 1.0.0 | O(1) |
SMEMBERS | SMEMBERS key | 1.0.0 | O(N) where N is the set cardinality. |
SMISMEMBER | SMISMEMBER key member [member ...] | 6.2.0 | O(N) where N is the number of elements being checked for membership |
SMOVE | SMOVE source destination member | 1.0.0 | O(1) |
SPOP | SPOP key [count] | 1.0.0 | Without the count argument O(1), otherwise O(N) where N is the value of the passed count. |
SRANDMEMBER | SRANDMEMBER key [count] | 1.0.0 | Without the count argument O(1), otherwise O(N) where N is the absolute value of the passed count. |
SREM | SREM key member [member ...] | 1.0.0 | O(N) where N is the number of members to be removed. |
SSCAN | SSCAN key cursor [MATCH pattern] [COUNT count] | 2.8.0 | O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection. |
SUNION | SUNION key [key ...] | 1.0.0 | O(N) where N is the total number of elements in all given sets. |
SUNIONSTORE | SUNIONSTORE destination key [key ...] | 1.0.0 | O(N) where N is the total number of elements in all given sets. |
| Command | Syntax | Since | Complexity |
|---|---|---|---|
BZMPOP | BZMPOP timeout numkeys key [key ...] <MIN | MAX> [COUNT count] | 7.0.0 | O(K) + O(M*log(N)) where K is the number of provided keys, N being the number of elements in the sorted set, and M being the number of elements popped. |
BZPOPMAX | BZPOPMAX key [key ...] timeout | 5.0.0 | O(log(N)) with N being the number of elements in the sorted set. |
BZPOPMIN | BZPOPMIN key [key ...] timeout | 5.0.0 | O(log(N)) with N being the number of elements in the sorted set. |
ZADD | ZADD key [NX | XX] [GT | LT] [CH] [INCR] score member [score member ...] | 1.2.0 | O(log(N)) for each item added, where N is the number of elements in the sorted set. |
ZCARD | ZCARD key | 1.2.0 | O(1) |
ZCOUNT | ZCOUNT key min max | 2.0.0 | O(log(N)) with N being the number of elements in the sorted set. |
ZDIFF | ZDIFF numkeys key [key ...] [WITHSCORES] | 6.2.0 | O(L + (N-K)log(N)) worst case where L is the total number of elements in all the sets, N is the size of the first set, and K is the size of the result set. |
ZDIFFSTORE | ZDIFFSTORE destination numkeys key [key ...] | 6.2.0 | O(L + (N-K)log(N)) worst case where L is the total number of elements in all the sets, N is the size of the first set, and K is the size of the result set. |
ZINCRBY | ZINCRBY key increment member | 1.2.0 | O(log(N)) where N is the number of elements in the sorted set. |
ZINTER | ZINTER numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM | MIN | MAX] [WITHSCORES] | 6.2.0 | O(N*K)+O(M*log(M)) worst case with N being the smallest input sorted set, K being the number of input sorted sets and M being the number of elements in the resulting sorted set. |
ZINTERCARD | ZINTERCARD numkeys key [key ...] [LIMIT limit] | 7.0.0 | O(N*K) worst case with N being the smallest input sorted set, K being the number of input sorted sets. |
ZINTERSTORE | ZINTERSTORE destination numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM | MIN | MAX] | 2.0.0 | O(N*K)+O(M*log(M)) worst case with N being the smallest input sorted set, K being the number of input sorted sets and M being the number of elements in the resulting sorted set. |
ZLEXCOUNT | ZLEXCOUNT key min max | 2.8.9 | O(log(N)) with N being the number of elements in the sorted set. |
ZMPOP | ZMPOP numkeys key [key ...] <MIN | MAX> [COUNT count] | 7.0.0 | O(K) + O(M*log(N)) where K is the number of provided keys, N being the number of elements in the sorted set, and M being the number of elements popped. |
ZMSCORE | ZMSCORE key member [member ...] | 6.2.0 | O(N) where N is the number of members being requested. |
ZPOPMAX | ZPOPMAX key [count] | 5.0.0 | O(log(N)*M) with N being the number of elements in the sorted set, and M being the number of elements popped. |
ZPOPMIN | ZPOPMIN key [count] | 5.0.0 | O(log(N)*M) with N being the number of elements in the sorted set, and M being the number of elements popped. |
ZRANDMEMBER | ZRANDMEMBER key [count [WITHSCORES]] | 6.2.0 | O(N) where N is the number of members returned |
ZRANGE | ZRANGE key start stop [BYSCORE | BYLEX] [REV] [LIMIT offset count] [WITHSCORES] | 1.2.0 | O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned. |
ZRANGEBYLEXDeprecated since 6.2.0Use instead: ZRANGE with the BYLEX argument | ZRANGEBYLEX key min max [LIMIT offset count] | 2.8.9 | O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)). |
ZRANGEBYSCOREDeprecated since 6.2.0Use instead: ZRANGE with the BYSCORE argument | ZRANGEBYSCORE key min max [WITHSCORES] [LIMIT offset count] | 1.0.5 | O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)). |
ZRANGESTORE | ZRANGESTORE dst src min max [BYSCORE | BYLEX] [REV] [LIMIT offset count] | 6.2.0 | O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements stored into the destination key. |
ZRANK | ZRANK key member [WITHSCORE] | 2.0.0 | O(log(N)) |
ZREM | ZREM key member [member ...] | 1.2.0 | O(M*log(N)) with N being the number of elements in the sorted set and M the number of elements to be removed. |
ZREMRANGEBYLEX | ZREMRANGEBYLEX key min max | 2.8.9 | O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation. |
ZREMRANGEBYRANK | ZREMRANGEBYRANK key start stop | 2.0.0 | O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation. |
ZREMRANGEBYSCORE | ZREMRANGEBYSCORE key min max | 1.2.0 | O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements removed by the operation. |
ZREVRANGEDeprecated since 6.2.0Use instead: ZRANGE with the REV argument | ZREVRANGE key start stop [WITHSCORES] | 1.2.0 | O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements returned. |
ZREVRANGEBYLEXDeprecated since 6.2.0Use instead: ZRANGE with the REV and BYLEX arguments | ZREVRANGEBYLEX key max min [LIMIT offset count] | 2.8.9 | O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)). |
ZREVRANGEBYSCOREDeprecated since 6.2.0Use instead: ZRANGE with the REV and BYSCORE arguments | ZREVRANGEBYSCORE key max min [WITHSCORES] [LIMIT offset count] | 2.2.0 | O(log(N)+M) with N being the number of elements in the sorted set and M the number of elements being returned. If M is constant (e.g. always asking for the first 10 elements with LIMIT), you can consider it O(log(N)). |
ZREVRANK | ZREVRANK key member [WITHSCORE] | 2.0.0 | O(log(N)) |
ZSCAN | ZSCAN key cursor [MATCH pattern] [COUNT count] | 2.8.0 | O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection. |
ZSCORE | ZSCORE key member | 1.2.0 | O(1) |
ZUNION | ZUNION numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM | MIN | MAX] [WITHSCORES] | 6.2.0 | O(N)+O(M*log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set. |
ZUNIONSTORE | ZUNIONSTORE destination numkeys key [key ...] [WEIGHTS weight [weight ...]] [AGGREGATE SUM | MIN | MAX] | 2.0.0 | O(N)+O(M log(M)) with N being the sum of the sizes of the input sorted sets, and M being the number of elements in the resulting sorted set. |
| Command | Syntax | Since | Complexity |
|---|---|---|---|
XACK | XACK key group ID [ID ...] | 5.0.0 | O(1) for each message ID processed. |
XADD | XADD key [NOMKSTREAM] [<MAXLEN | MINID> [= | ~] threshold [LIMIT count]] <* | id> field value [field value ...] | 5.0.0 | O(1) when adding a new entry, O(N) when trimming where N being the number of entries evicted. |
XAUTOCLAIM | XAUTOCLAIM key group consumer min-idle-time start [COUNT count] [JUSTID] | 6.2.0 | O(1) if COUNT is small. |
XCLAIM | XCLAIM key group consumer min-idle-time ID [ID ...] [IDLE ms] [TIME unix-time-milliseconds] [RETRYCOUNT count] [FORCE] [JUSTID] [LASTID lastid] | 5.0.0 | O(log N) with N being the number of messages in the PEL of the consumer group. |
XDEL | XDEL key ID [ID ...] | 5.0.0 | O(1) for each single item to delete in the stream, regardless of the stream size. |
XGROUP | XGROUP | 5.0.0 | Depends on subcommand. |
XGROUP CREATE | XGROUP CREATE key group <id | $> [MKSTREAM] [ENTRIESREAD entries-read] | 5.0.0 | O(1) |
XGROUP CREATECONSUMER | XGROUP CREATECONSUMER key group consumer | 6.2.0 | O(1) |
XGROUP DELCONSUMER | XGROUP DELCONSUMER key group consumer | 5.0.0 | O(1) |
XGROUP DESTROY | XGROUP DESTROY key group | 5.0.0 | O(N) where N is the number of entries in the group's pending entries list (PEL). |
XGROUP HELP | XGROUP HELP | 5.0.0 | O(1) |
XGROUP SETID | XGROUP SETID key group <id | $> [ENTRIESREAD entries-read] | 5.0.0 | O(1) |
XINFO | XINFO | 5.0.0 | Depends on subcommand. |
XINFO CONSUMERS | XINFO CONSUMERS key group | 5.0.0 | O(1) |
XINFO GROUPS | XINFO GROUPS key | 5.0.0 | O(1) |
XINFO HELP | XINFO HELP | 5.0.0 | O(1) |
XINFO STREAM | XINFO STREAM key [FULL [COUNT count]] | 5.0.0 | O(1) |
XLEN | XLEN key | 5.0.0 | O(1) |
XPENDING | XPENDING key group [[IDLE min-idle-time] start end count [consumer]] | 5.0.0 | O(N) with N being the number of elements returned, so asking for a small fixed number of entries per call is O(1). O(M), where M is the total number of entries scanned when used with the IDLE filter. When the command returns just the summary and the list of consumers is small, it runs in O(1) time; otherwise, an additional O(N) time for iterating every consumer. |
XRANGE | XRANGE key start end [COUNT count] | 5.0.0 | O(N) with N being the number of elements being returned. If N is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1). |
XREAD | XREAD [COUNT count] [BLOCK milliseconds] STREAMS key [key ...] ID [ID ...] | 5.0.0 | — |
XREADGROUP | XREADGROUP GROUP group consumer [COUNT count] [BLOCK milliseconds] [NOACK] STREAMS key [key ...] ID [ID ...] | 5.0.0 | For each stream mentioned: O(M) with M being the number of elements returned. If M is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1). On the other side when XREADGROUP blocks, XADD will pay the O(N) time in order to serve the N clients blocked on the stream getting new data. |
XREVRANGE | XREVRANGE key end start [COUNT count] | 5.0.0 | O(N) with N being the number of elements returned. If N is constant (e.g. always asking for the first 10 elements with COUNT), you can consider it O(1). |
XSETID | XSETID key last-id [ENTRIESADDED entries-added] [MAXDELETEDID max-deleted-id] | 5.0.0 | O(1) |
XTRIM | XTRIM key <MAXLEN | MINID> [= | ~] threshold [LIMIT count] | 5.0.0 | O(N), with N being the number of evicted entries. Constant times are very small however, since entries are organized in macro nodes containing multiple entries that can be released with a single deallocation. |
| Command | Syntax | Since | Complexity |
|---|---|---|---|
BITCOUNT | BITCOUNT key [start end [BYTE | BIT]] | 2.6.0 | O(N) |
BITFIELD | BITFIELD key [GET encoding offset | [OVERFLOW WRAP | SAT | FAIL] <SET encoding offset value | INCRBY encoding offset increment> [GET encoding offset | [OVERFLOW WRAP | SAT | FAIL] <SET encoding offset value | INCRBY encoding offset increment> ...]] | 3.2.0 | O(1) for each subcommand specified |
BITFIELD_RO | BITFIELD_RO key [GET encoding offset [GET encoding offset ...]] | 6.0.0 | O(1) for each subcommand specified |
BITOP | BITOP <AND | OR | XOR | NOT> destkey key [key ...] | 2.6.0 | O(N) |
BITPOS | BITPOS key bit [start [end [BYTE | BIT]]] | 2.8.7 | O(N) |
GETBIT | GETBIT key offset | 2.2.0 | O(1) |
SETBIT | SETBIT key offset value | 2.2.0 | O(1) |
| Command | Syntax | Since | Complexity |
|---|---|---|---|
PFADD | PFADD key [element [element ...]] | 2.8.9 | O(1) to add every element. |
PFCOUNT | PFCOUNT key [key ...] | 2.8.9 | O(1) with a very small average constant time when called with a single key. O(N) with N being the number of keys, and much bigger constant times, when called with multiple keys. |
PFDEBUG | PFDEBUG subcommand key | 2.8.9 | N/A |
PFMERGE | PFMERGE destkey [sourcekey [sourcekey ...]] | 2.8.9 | O(N) to merge N HyperLogLogs, but with high constant times. |
PFSELFTEST | PFSELFTEST | 2.8.9 | N/A |
| Command | Syntax | Since | Complexity |
|---|---|---|---|
GEOADD | GEOADD key [NX | XX] [CH] longitude latitude member [longitude latitude member ...] | 3.2.0 | O(log(N)) for each item added, where N is the number of elements in the sorted set. |
GEODIST | GEODIST key member1 member2 [m | km | ft | mi] | 3.2.0 | O(1) |
GEOHASH | GEOHASH key [member [member ...]] | 3.2.0 | O(1) for each member requested. |
GEOPOS | GEOPOS key [member [member ...]] | 3.2.0 | O(1) for each member requested. |
GEORADIUSDeprecated since 6.2.0Use instead: GEOSEARCH and GEOSEARCHSTORE with the BYRADIUS argument | GEORADIUS key longitude latitude radius <m | km | ft | mi> [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC | DESC] [STORE key | STOREDIST key] | 3.2.0 | O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index. |
GEORADIUSBYMEMBERDeprecated since 6.2.0Use instead: GEOSEARCH and GEOSEARCHSTORE with the BYRADIUS and FROMMEMBER arguments | GEORADIUSBYMEMBER key member radius <m | km | ft | mi> [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC | DESC] [STORE key | STOREDIST key] | 3.2.0 | O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index. |
GEORADIUSBYMEMBER_RODeprecated since 6.2.0Use instead: GEOSEARCH with the BYRADIUS and FROMMEMBER arguments | GEORADIUSBYMEMBER_RO key member radius <m | km | ft | mi> [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC | DESC] | 3.2.10 | O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index. |
GEORADIUS_RODeprecated since 6.2.0Use instead: GEOSEARCH with the BYRADIUS argument | GEORADIUS_RO key longitude latitude radius <m | km | ft | mi> [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count [ANY]] [ASC | DESC] | 3.2.10 | O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index. |
GEOSEARCH | GEOSEARCH key <FROMMEMBER member | FROMLONLAT longitude latitude> <BYRADIUS radius <m | km | ft | mi> | BYBOX width height <m | km | ft | mi>> [ASC | DESC] [COUNT count [ANY]] [WITHCOORD] [WITHDIST] [WITHHASH] | 6.2.0 | O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape |
GEOSEARCHSTORE | GEOSEARCHSTORE destination source <FROMMEMBER member | FROMLONLAT longitude latitude> <BYRADIUS radius <m | km | ft | mi> | BYBOX width height <m | km | ft | mi>> [ASC | DESC] [COUNT count [ANY]] [STOREDIST] | 6.2.0 | O(N+log(M)) where N is the number of elements in the grid-aligned bounding box area around the shape provided as the filter and M is the number of items inside the shape |
| Command | Syntax | Since | Complexity |
|---|---|---|---|
COPY | COPY source destination [DB destination-db] [REPLACE] | 6.2.0 | O(N) worst case for collections, where N is the number of nested items. O(1) for string values. |
DEL | DEL key [key ...] | 1.0.0 | O(N) where N is the number of keys that will be removed. When a key to remove holds a value other than a string, the individual complexity for this key is O(M) where M is the number of elements in the list, set, sorted set or hash. Removing a single key that holds a string value is O(1). |
DUMP | DUMP key | 2.6.0 | O(1) to access the key and additional O(N*M) to serialize it, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). |
EXISTS | EXISTS key [key ...] | 1.0.0 | O(N) where N is the number of keys to check. |
EXPIRE | EXPIRE key seconds [NX | XX | GT | LT] | 1.0.0 | O(1) |
EXPIREAT | EXPIREAT key unix-time-seconds [NX | XX | GT | LT] | 1.2.0 | O(1) |
EXPIRETIME | EXPIRETIME key | 7.0.0 | O(1) |
KEYS | KEYS pattern | 1.0.0 | O(N) with N being the number of keys in the database, under the assumption that the key names in the database and the given pattern have limited length. |
MIGRATE | MIGRATE host port <key | ""> destination-db timeout [COPY] [REPLACE] [AUTH password | AUTH2 username password] [KEYS key [key ...]] | 2.6.0 | This command actually executes a DUMP+DEL in the source instance, and a RESTORE in the target instance. See the pages of these commands for time complexity. Also an O(N) data transfer between the two instances is performed. |
MOVE | MOVE key db | 1.0.0 | O(1) |
OBJECT | OBJECT | 2.2.3 | Depends on subcommand. |
OBJECT ENCODING | OBJECT ENCODING key | 2.2.3 | O(1) |
OBJECT FREQ | OBJECT FREQ key | 4.0.0 | O(1) |
OBJECT HELP | OBJECT HELP | 6.2.0 | O(1) |
OBJECT IDLETIME | OBJECT IDLETIME key | 2.2.3 | O(1) |
OBJECT REFCOUNT | OBJECT REFCOUNT key | 2.2.3 | O(1) |
PERSIST | PERSIST key | 2.2.0 | O(1) |
PEXPIRE | PEXPIRE key milliseconds [NX | XX | GT | LT] | 2.6.0 | O(1) |
PEXPIREAT | PEXPIREAT key unix-time-milliseconds [NX | XX | GT | LT] | 2.6.0 | O(1) |
PEXPIRETIME | PEXPIRETIME key | 7.0.0 | O(1) |
PTTL | PTTL key | 2.6.0 | O(1) |
RANDOMKEY | RANDOMKEY | 1.0.0 | O(1) |
RENAME | RENAME key newkey | 1.0.0 | O(1) |
RENAMENX | RENAMENX key newkey | 1.0.0 | O(1) |
RESTORE | RESTORE key ttl serialized-value [REPLACE] [ABSTTL] [IDLETIME seconds] [FREQ frequency] | 2.6.0 | O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)). |
SCAN | SCAN cursor [MATCH pattern] [COUNT count] [TYPE type] | 2.8.0 | O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection. |
SORT | SORT key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern ...]] [ASC | DESC] [ALPHA] [STORE destination] | 1.0.0 | O(N+M*log(M)) where N is the number of elements in the list or set to sort, and M the number of returned elements. When the elements are not sorted, complexity is O(N). |
SORT_RO | SORT_RO key [BY pattern] [LIMIT offset count] [GET pattern [GET pattern ...]] [ASC | DESC] [ALPHA] | 7.0.0 | O(N+M*log(M)) where N is the number of elements in the list or set to sort, and M the number of returned elements. When the elements are not sorted, complexity is O(N). |
TOUCH | TOUCH key [key ...] | 3.2.1 | O(N) where N is the number of keys that will be touched. |
TTL | TTL key | 1.0.0 | O(1) |
TYPE | TYPE key | 1.0.0 | O(1) |
UNLINK | UNLINK key [key ...] | 4.0.0 | O(1) for each key removed regardless of its size. Then the command does O(N) work in a different thread in order to reclaim memory, where N is the number of allocations the deleted objects where composed of. |
WAIT | WAIT numreplicas timeout | 3.0.0 | O(1) |
WAITAOF | WAITAOF numlocal numreplicas timeout | 7.2.0 | O(1) |
| Command | Syntax | Since | Complexity |
|---|---|---|---|
PSUBSCRIBE | PSUBSCRIBE pattern [pattern ...] | 2.0.0 | O(N) where N is the number of patterns to subscribe to. |
PUBLISH | PUBLISH channel message | 2.0.0 | O(N+M) where N is the number of clients subscribed to the receiving channel and M is the total number of subscribed patterns (by any client). |
PUBSUB | PUBSUB | 2.8.0 | Depends on subcommand. |
PUBSUB CHANNELS | PUBSUB CHANNELS [pattern] | 2.8.0 | O(N) where N is the number of active channels, and assuming constant time pattern matching (relatively short channels and patterns) |
PUBSUB HELP | PUBSUB HELP | 6.2.0 | O(1) |
PUBSUB NUMPAT | PUBSUB NUMPAT | 2.8.0 | O(1) |
PUBSUB NUMSUB | PUBSUB NUMSUB [channel [channel ...]] | 2.8.0 | O(N) for the NUMSUB subcommand, where N is the number of requested channels |
PUBSUB SHARDCHANNELS | PUBSUB SHARDCHANNELS [pattern] | 7.0.0 | O(N) where N is the number of active shard channels, and assuming constant time pattern matching (relatively short shard channels). |
PUBSUB SHARDNUMSUB | PUBSUB SHARDNUMSUB [shardchannel [shardchannel ...]] | 7.0.0 | O(N) for the SHARDNUMSUB subcommand, where N is the number of requested shard channels |
PUNSUBSCRIBE | PUNSUBSCRIBE [pattern [pattern ...]] | 2.0.0 | O(N) where N is the number of patterns to unsubscribe. |
SPUBLISH | SPUBLISH shardchannel message | 7.0.0 | O(N) where N is the number of clients subscribed to the receiving shard channel. |
SSUBSCRIBE | SSUBSCRIBE shardchannel [shardchannel ...] | 7.0.0 | O(N) where N is the number of shard channels to subscribe to. |
SUBSCRIBE | SUBSCRIBE channel [channel ...] | 2.0.0 | O(N) where N is the number of channels to subscribe to. |
SUNSUBSCRIBE | SUNSUBSCRIBE [shardchannel [shardchannel ...]] | 7.0.0 | O(N) where N is the number of shard channels to unsubscribe. |
UNSUBSCRIBE | UNSUBSCRIBE [channel [channel ...]] | 2.0.0 | O(N) where N is the number of channels to unsubscribe. |
| Command | Syntax | Since | Complexity |
|---|---|---|---|
EVAL | EVAL script numkeys [key [key ...]] [arg [arg ...]] | 2.6.0 | Depends on the script that is executed. |
EVALSHA | EVALSHA sha1 numkeys [key [key ...]] [arg [arg ...]] | 2.6.0 | Depends on the script that is executed. |
EVALSHA_RO | EVALSHA_RO sha1 numkeys [key [key ...]] [arg [arg ...]] | 7.0.0 | Depends on the script that is executed. |
EVAL_RO | EVAL_RO script numkeys [key [key ...]] [arg [arg ...]] | 7.0.0 | Depends on the script that is executed. |
FCALL | FCALL function numkeys [key [key ...]] [arg [arg ...]] | 7.0.0 | Depends on the function that is executed. |
FCALL_RO | FCALL_RO function numkeys [key [key ...]] [arg [arg ...]] | 7.0.0 | Depends on the function that is executed. |
FUNCTION | FUNCTION | 7.0.0 | Depends on subcommand. |
FUNCTION DELETE | FUNCTION DELETE library-name | 7.0.0 | O(1) |
FUNCTION DUMP | FUNCTION DUMP | 7.0.0 | O(N) where N is the number of functions |
FUNCTION FLUSH | FUNCTION FLUSH [ASYNC | SYNC] | 7.0.0 | O(N) where N is the number of functions deleted |
FUNCTION HELP | FUNCTION HELP | 7.0.0 | O(1) |
FUNCTION KILL | FUNCTION KILL | 7.0.0 | O(1) |
FUNCTION LIST | FUNCTION LIST [LIBRARYNAME library-name-pattern] [WITHCODE] | 7.0.0 | O(N) where N is the number of functions |
FUNCTION LOAD | FUNCTION LOAD [REPLACE] function-code | 7.0.0 | O(1) (considering compilation time is redundant) |
FUNCTION RESTORE | FUNCTION RESTORE serialized-value [FLUSH | APPEND | REPLACE] | 7.0.0 | O(N) where N is the number of functions on the payload |
FUNCTION STATS | FUNCTION STATS | 7.0.0 | O(1) |
SCRIPT | SCRIPT | 2.6.0 | Depends on subcommand. |
SCRIPT DEBUG | SCRIPT DEBUG <YES | SYNC | NO> | 3.2.0 | O(1) |
SCRIPT EXISTS | SCRIPT EXISTS sha1 [sha1 ...] | 2.6.0 | O(N) with N being the number of scripts to check (so checking a single script is an O(1) operation). |
SCRIPT FLUSH | SCRIPT FLUSH [ASYNC | SYNC] | 2.6.0 | O(N) with N being the number of scripts in cache |
SCRIPT HELP | SCRIPT HELP | 5.0.0 | O(1) |
SCRIPT KILL | SCRIPT KILL | 2.6.0 | O(1) |
SCRIPT LOAD | SCRIPT LOAD script | 2.6.0 | O(N) with N being the length in bytes of the script body. |
| Command | Syntax | Since | Complexity |
|---|---|---|---|
AUTH | AUTH [username] password | 1.0.0 | O(N) where N is the number of passwords defined for the user |
CLIENT | CLIENT | 2.4.0 | Depends on subcommand. |
CLIENT CACHING | CLIENT CACHING <YES | NO> | 6.0.0 | O(1) |
CLIENT GETNAME | CLIENT GETNAME | 2.6.9 | O(1) |
CLIENT GETREDIR | CLIENT GETREDIR | 6.0.0 | O(1) |
CLIENT HELP | CLIENT HELP | 5.0.0 | O(1) |
CLIENT ID | CLIENT ID | 5.0.0 | O(1) |
CLIENT INFO | CLIENT INFO | 6.2.0 | O(1) |
CLIENT KILL | CLIENT KILL <ip:port | <[ID client-id] | [TYPE normal | master | slave | replica | pubsub] | [USER username] | [ADDR ip:port] | [LADDR ip:port] | [SKIPME YES | NO] [[ID client-id] | [TYPE normal | master | slave | replica | pubsub] | [USER username] | [ADDR ip:port] | [LADDR ip:port] | [SKIPME YES | NO] ...]>> | 2.4.0 | O(N) where N is the number of client connections |
CLIENT LIST | CLIENT LIST [TYPE normal | master | replica | pubsub] [ID client-id [client-id ...]] | 2.4.0 | O(N) where N is the number of client connections |
CLIENT NO-EVICT | CLIENT NO-EVICT <ON | OFF> | 7.0.0 | O(1) |
CLIENT NO-TOUCH | CLIENT NO-TOUCH <ON | OFF> | 7.2.0 | O(1) |
CLIENT PAUSE | CLIENT PAUSE timeout [WRITE | ALL] | 3.0.0 | O(1) |
CLIENT REPLY | CLIENT REPLY <ON | OFF | SKIP> | 3.2.0 | O(1) |
CLIENT SETINFO | CLIENT SETINFO <lib-name libname | lib-ver libver> | 7.2.0 | O(1) |
CLIENT SETNAME | CLIENT SETNAME connection-name | 2.6.9 | O(1) |
CLIENT TRACKING | CLIENT TRACKING <ON | OFF> [REDIRECT client-id] [PREFIX prefix [PREFIX prefix ...]] [BCAST] [OPTIN] [OPTOUT] [NOLOOP] | 6.0.0 | O(1). Some options may introduce additional complexity. |
CLIENT TRACKINGINFO | CLIENT TRACKINGINFO | 6.2.0 | O(1) |
CLIENT UNBLOCK | CLIENT UNBLOCK client-id [TIMEOUT | ERROR] | 5.0.0 | O(log N) where N is the number of client connections |
CLIENT UNPAUSE | CLIENT UNPAUSE | 6.2.0 | O(N) Where N is the number of paused clients |
ECHO | ECHO message | 1.0.0 | O(1) |
HELLO | HELLO [protover [AUTH username password] [SETNAME clientname]] | 6.0.0 | O(1) |
PING | PING [message] | 1.0.0 | O(1) |
QUITDeprecated since 7.2.0Use instead: just closing the connection | QUIT | 1.0.0 | O(1) |
RESET | RESET | 6.2.0 | O(1) |
SELECT | SELECT index | 1.0.0 | O(1) |
| Command | Syntax | Since | Complexity |
|---|---|---|---|
ACL | ACL | 6.0.0 | Depends on subcommand. |
ACL CAT | ACL CAT [category] | 6.0.0 | O(1) since the categories and commands are a fixed set. |
ACL DELUSER | ACL DELUSER username [username ...] | 6.0.0 | O(1) amortized time considering the typical user. |
ACL DRYRUN | ACL DRYRUN username command [arg [arg ...]] | 7.0.0 | O(1). |
ACL GENPASS | ACL GENPASS [bits] | 6.0.0 | O(1) |
ACL GETUSER | ACL GETUSER username | 6.0.0 | O(N). Where N is the number of password, command and pattern rules that the user has. |
ACL HELP | ACL HELP | 6.0.0 | O(1) |
ACL LIST | ACL LIST | 6.0.0 | O(N). Where N is the number of configured users. |
ACL LOAD | ACL LOAD | 6.0.0 | O(N). Where N is the number of configured users. |
ACL LOG | ACL LOG [count | RESET] | 6.0.0 | O(N) with N being the number of entries shown. |
ACL SAVE | ACL SAVE | 6.0.0 | O(N). Where N is the number of configured users. |
ACL SETUSER | ACL SETUSER username [rule [rule ...]] | 6.0.0 | O(N). Where N is the number of rules provided. |
ACL USERS | ACL USERS | 6.0.0 | O(N). Where N is the number of configured users. |
ACL WHOAMI | ACL WHOAMI | 6.0.0 | O(1) |
BGREWRITEAOF | BGREWRITEAOF | 1.0.0 | O(1) |
BGSAVE | BGSAVE [SCHEDULE] | 1.0.0 | O(1) |
COMMAND | COMMAND | 2.8.13 | O(N) where N is the total number of Redis commands |
COMMAND COUNT | COMMAND COUNT | 2.8.13 | O(1) |
COMMAND DOCS | COMMAND DOCS [command-name [command-name ...]] | 7.0.0 | O(N) where N is the number of commands to look up |
COMMAND GETKEYS | COMMAND GETKEYS command [arg [arg ...]] | 2.8.13 | O(N) where N is the number of arguments to the command |
COMMAND GETKEYSANDFLAGS | COMMAND GETKEYSANDFLAGS command [arg [arg ...]] | 7.0.0 | O(N) where N is the number of arguments to the command |
COMMAND HELP | COMMAND HELP | 5.0.0 | O(1) |
COMMAND INFO | COMMAND INFO [command-name [command-name ...]] | 2.8.13 | O(N) where N is the number of commands to look up |
COMMAND LIST | COMMAND LIST [FILTERBY MODULE module-name | ACLCAT category | PATTERN pattern] | 7.0.0 | O(N) where N is the total number of Redis commands |
CONFIG | CONFIG | 2.0.0 | Depends on subcommand. |
CONFIG GET | CONFIG GET parameter [parameter ...] | 2.0.0 | O(N) when N is the number of configuration parameters provided |
CONFIG HELP | CONFIG HELP | 5.0.0 | O(1) |
CONFIG RESETSTAT | CONFIG RESETSTAT | 2.0.0 | O(1) |
CONFIG REWRITE | CONFIG REWRITE | 2.8.0 | O(1) |
CONFIG SET | CONFIG SET parameter value [parameter value ...] | 2.0.0 | O(N) when N is the number of configuration parameters provided |
DBSIZE | DBSIZE | 1.0.0 | O(1) |
DEBUG | DEBUG | 1.0.0 | Depends on subcommand. |
FAILOVER | FAILOVER [TO host port [FORCE]] [ABORT] [TIMEOUT milliseconds] | 6.2.0 | O(1) |
FLUSHALL | FLUSHALL [ASYNC | SYNC] | 1.0.0 | O(N) where N is the total number of keys in all databases |
FLUSHDB | FLUSHDB [ASYNC | SYNC] | 1.0.0 | O(N) where N is the number of keys in the selected database |
INFO | INFO [section [section ...]] | 1.0.0 | O(1) |
LASTSAVE | LASTSAVE | 1.0.0 | O(1) |
LATENCY | LATENCY | 2.8.13 | Depends on subcommand. |
LATENCY DOCTOR | LATENCY DOCTOR | 2.8.13 | O(1) |
LATENCY GRAPH | LATENCY GRAPH event | 2.8.13 | O(1) |
LATENCY HELP | LATENCY HELP | 2.8.13 | O(1) |
LATENCY HISTOGRAM | LATENCY HISTOGRAM [COMMAND [COMMAND ...]] | 7.0.0 | O(N) where N is the number of commands with latency information being retrieved. |
LATENCY HISTORY | LATENCY HISTORY event | 2.8.13 | O(1) |
LATENCY LATEST | LATENCY LATEST | 2.8.13 | O(1) |
LATENCY RESET | LATENCY RESET [event [event ...]] | 2.8.13 | O(1) |
LOLWUT | LOLWUT [VERSION version] | 5.0.0 | — |
MEMORY | MEMORY | 4.0.0 | Depends on subcommand. |
MEMORY DOCTOR | MEMORY DOCTOR | 4.0.0 | O(1) |
MEMORY HELP | MEMORY HELP | 4.0.0 | O(1) |
MEMORY MALLOC-STATS | MEMORY MALLOC-STATS | 4.0.0 | Depends on how much memory is allocated, could be slow |
MEMORY PURGE | MEMORY PURGE | 4.0.0 | Depends on how much memory is allocated, could be slow |
MEMORY STATS | MEMORY STATS | 4.0.0 | O(1) |
MEMORY USAGE | MEMORY USAGE key [SAMPLES count] | 4.0.0 | O(N) where N is the number of samples. |
MODULE | MODULE | 4.0.0 | Depends on subcommand. |
MODULE HELP | MODULE HELP | 5.0.0 | O(1) |
MODULE LIST | MODULE LIST | 4.0.0 | O(N) where N is the number of loaded modules. |
MODULE LOAD | MODULE LOAD path [arg [arg ...]] | 4.0.0 | O(1) |
MODULE LOADEX | MODULE LOADEX path [CONFIG name value [CONFIG name value ...]] [ARGS args [args ...]] | 7.0.0 | O(1) |
MODULE UNLOAD | MODULE UNLOAD name | 4.0.0 | O(1) |
MONITOR | MONITOR | 1.0.0 | — |
PSYNC | PSYNC replicationid offset | 2.8.0 | — |
REPLCONF | REPLCONF | 3.0.0 | O(1) |
REPLICAOF | REPLICAOF <host port | NO ONE> | 5.0.0 | O(1) |
RESTORE-ASKING | RESTORE-ASKING key ttl serialized-value [REPLACE] [ABSTTL] [IDLETIME seconds] [FREQ frequency] | 3.0.0 | O(1) to create the new key and additional O(N*M) to reconstruct the serialized value, where N is the number of Redis objects composing the value and M their average size. For small string values the time complexity is thus O(1)+O(1*M) where M is small, so simply O(1). However for sorted set values the complexity is O(N*M*log(N)) because inserting values into sorted sets is O(log(N)). |
ROLE | ROLE | 2.8.12 | O(1) |
SAVE | SAVE | 1.0.0 | O(N) where N is the total number of keys in all databases |
SHUTDOWN | SHUTDOWN [NOSAVE | SAVE] [NOW] [FORCE] [ABORT] | 1.0.0 | O(N) when saving, where N is the total number of keys in all databases when saving data, otherwise O(1) |
SLAVEOFDeprecated since 5.0.0Use instead: REPLICAOF | SLAVEOF <host port | NO ONE> | 1.0.0 | O(1) |
SLOWLOG | SLOWLOG | 2.2.12 | Depends on subcommand. |
SLOWLOG GET | SLOWLOG GET [count] | 2.2.12 | O(N) where N is the number of entries returned |
SLOWLOG HELP | SLOWLOG HELP | 6.2.0 | O(1) |
SLOWLOG LEN | SLOWLOG LEN | 2.2.12 | O(1) |
SLOWLOG RESET | SLOWLOG RESET | 2.2.12 | O(N) where N is the number of entries in the slowlog |
SWAPDB | SWAPDB index1 index2 | 4.0.0 | O(N) where N is the count of clients watching or blocking on keys from both databases. |
SYNC | SYNC | 1.0.0 | — |
TIME | TIME | 2.6.0 | O(1) |
| Command | Syntax | Since | Complexity |
|---|---|---|---|
ASKING | ASKING | 3.0.0 | O(1) |
CLUSTER | CLUSTER | 3.0.0 | Depends on subcommand. |
CLUSTER ADDSLOTS | CLUSTER ADDSLOTS slot [slot ...] | 3.0.0 | O(N) where N is the total number of hash slot arguments |
CLUSTER ADDSLOTSRANGE | CLUSTER ADDSLOTSRANGE start-slot end-slot [start-slot end-slot ...] | 7.0.0 | O(N) where N is the total number of the slots between the start slot and end slot arguments. |
CLUSTER BUMPEPOCH | CLUSTER BUMPEPOCH | 3.0.0 | O(1) |
CLUSTER COUNT-FAILURE-REPORTS | CLUSTER COUNT-FAILURE-REPORTS node-id | 3.0.0 | O(N) where N is the number of failure reports |
CLUSTER COUNTKEYSINSLOT | CLUSTER COUNTKEYSINSLOT slot | 3.0.0 | O(1) |
CLUSTER DELSLOTS | CLUSTER DELSLOTS slot [slot ...] | 3.0.0 | O(N) where N is the total number of hash slot arguments |
CLUSTER DELSLOTSRANGE | CLUSTER DELSLOTSRANGE start-slot end-slot [start-slot end-slot ...] | 7.0.0 | O(N) where N is the total number of the slots between the start slot and end slot arguments. |
CLUSTER FAILOVER | CLUSTER FAILOVER [FORCE | TAKEOVER] | 3.0.0 | O(1) |
CLUSTER FLUSHSLOTS | CLUSTER FLUSHSLOTS | 3.0.0 | O(1) |
CLUSTER FORGET | CLUSTER FORGET node-id | 3.0.0 | O(1) |
CLUSTER GETKEYSINSLOT | CLUSTER GETKEYSINSLOT slot count | 3.0.0 | O(N) where N is the number of requested keys |
CLUSTER HELP | CLUSTER HELP | 5.0.0 | O(1) |
CLUSTER INFO | CLUSTER INFO | 3.0.0 | O(1) |
CLUSTER KEYSLOT | CLUSTER KEYSLOT key | 3.0.0 | O(N) where N is the number of bytes in the key |
CLUSTER LINKS | CLUSTER LINKS | 7.0.0 | O(N) where N is the total number of Cluster nodes |
CLUSTER MEET | CLUSTER MEET ip port [cluster-bus-port] | 3.0.0 | O(1) |
CLUSTER MYID | CLUSTER MYID | 3.0.0 | O(1) |
CLUSTER MYSHARDID | CLUSTER MYSHARDID | 7.2.0 | O(1) |
CLUSTER NODES | CLUSTER NODES | 3.0.0 | O(N) where N is the total number of Cluster nodes |
CLUSTER REPLICAS | CLUSTER REPLICAS node-id | 5.0.0 | O(N) where N is the number of replicas. |
CLUSTER REPLICATE | CLUSTER REPLICATE node-id | 3.0.0 | O(1) |
CLUSTER RESET | CLUSTER RESET [HARD | SOFT] | 3.0.0 | O(N) where N is the number of known nodes. The command may execute a FLUSHALL as a side effect. |
CLUSTER SAVECONFIG | CLUSTER SAVECONFIG | 3.0.0 | O(1) |
CLUSTER SET-CONFIG-EPOCH | CLUSTER SET-CONFIG-EPOCH config-epoch | 3.0.0 | O(1) |
CLUSTER SETSLOT | CLUSTER SETSLOT slot <IMPORTING node-id | MIGRATING node-id | NODE node-id | STABLE> | 3.0.0 | O(1) |
CLUSTER SHARDS | CLUSTER SHARDS | 7.0.0 | O(N) where N is the total number of cluster nodes |
CLUSTER SLAVESDeprecated since 5.0.0Use instead: CLUSTER REPLICAS | CLUSTER SLAVES node-id | 3.0.0 | O(N) where N is the number of replicas. |
CLUSTER SLOTSDeprecated since 7.0.0Use instead: CLUSTER SHARDS | CLUSTER SLOTS | 3.0.0 | O(N) where N is the total number of Cluster nodes |
READONLY | READONLY | 3.0.0 | O(1) |
READWRITE | READWRITE | 3.0.0 | O(1) |
| Command | Syntax | Since | Complexity |
|---|---|---|---|
SENTINEL | SENTINEL | 2.8.4 | Depends on subcommand. |
SENTINEL CKQUORUM | SENTINEL CKQUORUM master-name | 2.8.4 | — |
SENTINEL CONFIG | SENTINEL CONFIG <SET parameter value [SET parameter value ...] | GET parameter [parameter ...]> | 6.2.0 | O(N) when N is the number of configuration parameters provided |
SENTINEL DEBUG | SENTINEL DEBUG [parameter value [parameter value ...]] | 7.0.0 | O(N) where N is the number of configurable parameters |
SENTINEL FAILOVER | SENTINEL FAILOVER master-name | 2.8.4 | — |
SENTINEL FLUSHCONFIG | SENTINEL FLUSHCONFIG | 2.8.4 | O(1) |
SENTINEL GET-MASTER-ADDR-BY-NAME | SENTINEL GET-MASTER-ADDR-BY-NAME master-name | 2.8.4 | O(1) |
SENTINEL HELP | SENTINEL HELP | 6.2.0 | O(1) |
SENTINEL INFO-CACHE | SENTINEL INFO-CACHE nodename [nodename ...] | 3.2.0 | O(N) where N is the number of instances |
SENTINEL IS-MASTER-DOWN-BY-ADDR | SENTINEL IS-MASTER-DOWN-BY-ADDR ip port current-epoch runid | 2.8.4 | O(1) |
SENTINEL MASTER | SENTINEL MASTER master-name | 2.8.4 | O(1) |
SENTINEL MASTERS | SENTINEL MASTERS | 2.8.4 | O(N) where N is the number of masters |
SENTINEL MONITOR | SENTINEL MONITOR name ip port quorum | 2.8.4 | O(1) |
SENTINEL MYID | SENTINEL MYID | 6.2.0 | O(1) |
SENTINEL PENDING-SCRIPTS | SENTINEL PENDING-SCRIPTS | 2.8.4 | — |
SENTINEL REMOVE | SENTINEL REMOVE master-name | 2.8.4 | O(1) |
SENTINEL REPLICAS | SENTINEL REPLICAS master-name | 5.0.0 | O(N) where N is the number of replicas |
SENTINEL RESET | SENTINEL RESET pattern | 2.8.4 | O(N) where N is the number of monitored masters |
SENTINEL SENTINELS | SENTINEL SENTINELS master-name | 2.8.4 | O(N) where N is the number of Sentinels |
SENTINEL SET | SENTINEL SET master-name option value [option value ...] | 2.8.4 | O(1) |
SENTINEL SIMULATE-FAILURE | SENTINEL SIMULATE-FAILURE [crash-after-election | crash-after-promotion | help [crash-after-election | crash-after-promotion | help ...]] | 3.2.0 | — |
SENTINEL SLAVESDeprecated since 5.0.0Use instead: SENTINEL REPLICAS | SENTINEL SLAVES master-name | 2.8.0 | O(N) where N is the number of replicas. |
Where this data comes from
Every row is generated from the Redis 7.2.4 source tree (src/commands/*.json, BSD-3-Clause — the license text ships with this site's source). Complexity strings are the source's own O(…) text, verbatim. Commands added after Redis 7.2 are not listed, because newer Redis source trees use licenses this site does not ship from. Nothing here connects to a Redis server — search, syntax and the builder all run in your browser.
Do it offline:$ redis-cli SET session:42 "alpha" EX 60 NX
How to use it
- Type what you're looking for — a command name like zadd, a fragment like kill, or a word from a description such as expiration. Press / to focus the search box; the group menu narrows the tables to one data type at a time.
- Read the row. Each one shows the full syntax derived from the Redis source, the version that introduced the command, and the cost the source itself declares for it — and each row keeps a stable anchor like #zadd you can hand to a teammate.
- Need a runnable line? Pick a pattern in the builder — SET with expiry, ZADD with score flags, a SCAN loop — fill in the fields, and copy the finished redis-cli command. Invalid values are refused beside the field before they reach a terminal.
All 392 commands of Redis 7.2 on one page, with every syntax line generated from the Redis source itself and the complexity and since-version printed beside each. Search by name or description, narrow to a group, or assemble common commands for redis-cli with guided fields. Everything runs in your browser: nothing you type is sent anywhere, and no Redis server is ever contacted.
How it works
This page is generated from the command metadata that ships inside Redis itself. The Redis 7.2.4 source tree carries one JSON file per command under src/commands/ — 392 of them — declaring its name, group, summary, arity, argument tree, first version and computational cost. A build-time script turns that vendored tree into these tables; no hand-typed row exists on this page.
Syntax lines are rendered from the argument metadata by a small, fixed grammar: square brackets mark an optional part, a pipe separates alternatives, angle brackets wrap a required choice, an UPPERCASE word is a literal token you type as-is, and a trailing [x ...] means the part repeats. The renderer reads the same fields the server's parser is built from, so any line can be checked against its file in the source.
The version pin is a license decision: the Redis 7.2 line is the last series published under the permissive BSD-3-Clause license, and 7.2.4 is the tree vendored, credited and shipped with this site. Later Redis series changed to licenses this project does not redistribute from, so a command introduced after 7.2 does not appear here.
The builder assembles text only. Each of its 20 patterns instantiates one command from typed fields, quotes values so the line survives a POSIX shell intact, and refuses per field what Redis itself would refuse — and a test suite checks every literal token it can emit against the source's argument metadata, so it can never invent an option.
Examples
Cache a value for 60 seconds, only if the key is newredis-cli SET session:42 "alpha" NX EX 60NX makes the write conditional on the key not existing; EX 60 sets the expiry in one round trip. SET accepts these options in any order — this builder emits the order the source declares.
Raise scores on a leaderboard without ever lowering oneredis-cli ZADD board GT CH 100 "ada" 95.5 "grace"GT only applies an update when the new score is greater; CH makes the reply count changed members instead of only added ones. GT and LT cannot ride with NX — the builder refuses that combination the same way the server would.
Walk the keyspace for session keys without blocking Redisredis-cli SCAN 0 MATCH "user:*" COUNT 100Start at cursor 0 and feed each reply's cursor back in until it returns 0 again. The pattern is shell-quoted so your terminal can't expand the asterisk before redis-cli sees it.
Put a fresh TTL on a session key, but never create oneredis-cli EXPIRE session:42 60 NXEXPIRE's NX flag (added in Redis 7.0.0) only sets the timeout when the key has none yet — handy for grace-period logic that must not refresh an existing countdown.
Append a reading to a stream and let Redis pick the IDredis-cli XADD sensor:1 "*" temp "21"The * ID asks the server to mint a monotonic entry ID. It is quoted in the emitted line because an unquoted asterisk is a glob in every POSIX shell.
Every example on this page is executed against the same engine that powers the tool, on every build.
Gotchas worth knowing
SCAN, not KEYS, anywhere near production
KEYS walks the entire keyspace in one blocking call — O(N) with the server unable to answer anything else while it runs. SCAN does the same walk in bounded steps with a cursor you feed back in, at the price of possible duplicates and a snapshot-free view. The builder ships a SCAN pattern and deliberately has no KEYS pattern.
Expiry has two resolutions and three answers
EXPIRE counts seconds, PEXPIRE milliseconds, and EXPIREAT/PEXPIREAT take absolute Unix times — pick the wrong one and a timestamp becomes a 54-year countdown. When you read it back, TTL answers -1 for a key with no expiry and -2 for a key that does not exist; treating those two as interchangeable hides real bugs.
GETSET is the pattern, SET … GET is the command
The source marks GETSET deprecated since 6.2.0 and points at SET with the GET option, which does the same swap while also taking expiry flags. Rows this page marks Deprecated carry that ruling straight from the source metadata, replacement included.
CLIENT KILL is one command, not a command with an argument
Redis groups administrative commands into containers — CLIENT, CONFIG, ACL, XINFO — and each subcommand is its own entry with its own arity, since-version and complexity. That is why this page lists CLIENT KILL and CLIENT LIST as separate rows, each with its own #client-kill-style anchor.
Multi-key commands meet hash slots in Cluster
In Redis Cluster, a multi-key call like DEL a b c only works when every key hashes to the same slot. Braces force that: {user:1}.cart and {user:1}.profile hash on the {user:1} part alone, so they travel together. Single-instance Redis ignores the braces entirely.
Common errors
FAQ
Why is a command from Redis 8 missing here?
Because of licensing, not oversight. This page is generated from the Redis 7.2.4 source — the 7.2 line is the last Redis series published under the permissive BSD-3-Clause license. Newer trees moved to licenses this site does not redistribute from, so commands introduced after 7.2 are absent — the page names its source rather than quietly mixing versions.
Does this page talk to a Redis server?
No. There is no connection form, no socket, and no request leaves your browser. Search runs over data shipped with the page, and the builder only writes command text for you to paste into your own redis-cli.
Where do the complexity values come from?
They are the O(…) declarations from each command's metadata file in the Redis source, reproduced verbatim. A few commands declare none, and those rows show a dash instead of an invented figure.
How do I read the syntax notation?
Anything in square brackets is optional; alternatives are separated by a vertical bar; a required choice sits in angle brackets; and x [x ...] means the part may repeat. UPPERCASE words are literal tokens; lowercase words are placeholders for your values — except the geo units m | km | ft | mi and the client connection types such as normal and pubsub, lowercase literals you type exactly as shown.
Can I link a teammate straight to one command?
Yes — every row has a permanent anchor named after the command, like #zadd or #client-kill. The Share button also produces a link that restores your current search text and group choice; it carries nothing else.
Why did my search only match names at first?
The full descriptions load in small per-group files the moment you start searching, so the page itself stays light. Until they arrive the search honestly matches command names only, and a status line under the box says so; once loaded, description text joins the match.