Command compatibility

This document is generated by parsing the official redis command documentation

Generic

COPY

Copies the value of a key to a new key.

  • Documentation: COPY

  • Implementation: copy()

  • New in redis: 6.2.0

  • Added in version 3.0.0.

DEL

Deletes one or more keys.

DUMP

Returns a serialized representation of the value stored at a key.

EXISTS

Determines whether one or more keys exist.

EXPIRE

Sets the expiration time of a key in seconds.

EXPIREAT

Sets the expiration time of a key to a Unix timestamp.

EXPIRETIME

Returns the expiration time of a key as a Unix timestamp.

KEYS

Returns all key names that match a pattern.

MIGRATE

Atomically transfers a key from one Redis instance to another.

MOVE

Moves a key to another database.

OBJECT ENCODING

Returns the internal encoding of a Redis object.

OBJECT FREQ

Returns the logarithmic access frequency counter of a Redis object.

OBJECT IDLETIME

Returns the time since the last access to a Redis object.

OBJECT REFCOUNT

Returns the reference count of a value of a key.

PERSIST

Removes the expiration time of a key.

PEXPIRE

Sets the expiration time of a key in milliseconds.

PEXPIREAT

Sets the expiration time of a key to a Unix milliseconds timestamp.

PEXPIRETIME

Returns the expiration time of a key as a Unix milliseconds timestamp.

PTTL

Returns the expiration time in milliseconds of a key.

RANDOMKEY

Returns a random key name from the database.

RENAME

Renames a key and overwrites the destination.

RENAMENX

Renames a key only when the target key name doesn’t exist.

RESTORE

Creates a key from the serialized representation of a value.

SCAN

Iterates over the key names in the database.

SORT

Sorts the elements in a list, a set, or a sorted set, optionally storing the result.

SORT_RO

Returns the sorted elements of a list, a set, or a sorted set.

  • Documentation: SORT_RO

  • Implementation: sort_ro()

  • New in redis: 7.0.0

  • Added in version 3.0.0.

TOUCH

Returns the number of existing keys out of those specified after updating the time they were last accessed.

TTL

Returns the expiration time in seconds of a key.

  • Documentation: TTL

  • Implementation: ttl()

TYPE

Determines the type of value stored at a key.

  • Documentation: TYPE

  • Implementation: type()

  • Supports client caching: yes

WAIT

Blocks until the asynchronous replication of all preceding write commands sent by the connection is completed.

WAITAOF

Blocks until all of the preceding write commands sent by the connection are written to the append-only file of the master and/or replicas.

String

APPEND

Appends a string to the value of a key. Creates the key if it doesn’t exist.

DECR

Decrements the integer value of a key by one. Uses 0 as initial value if the key doesn’t exist.

DECRBY

Decrements a number from the integer value of a key. Uses 0 as initial value if the key doesn’t exist.

GET

Returns the string value of a key.

  • Documentation: GET

  • Implementation: get()

  • Supports client caching: yes

GETDEL

Returns the string value of a key after deleting the key.

GETEX

Returns the string value of a key after setting its expiration time.

  • Documentation: GETEX

  • Implementation: getex()

  • New in redis: 6.2.0

GETRANGE

Returns a substring of the string stored at a key.

GETSET

Returns the previous string value of a key after setting it to a new value.

  • Documentation: GETSET

  • Implementation: getset()

  • Deprecated in redis: 6.2.0. Use set() with the _get argument

INCR

Increments the integer value of a key by one. Uses 0 as initial value if the key doesn’t exist.

INCRBY

Increments the integer value of a key by a number. Uses 0 as initial value if the key doesn’t exist.

INCRBYFLOAT

Increment the floating point value of a key by a number. Uses 0 as initial value if the key doesn’t exist.

LCS

Finds the longest common substring.

  • Documentation: LCS

  • Implementation: lcs()

  • New in redis: 7.0.0

  • Added in version 3.0.0.

MGET

Atomically returns the string values of one or more keys.

MSET

Atomically creates or modifies the string values of one or more keys.

MSETNX

Atomically modifies the string values of one or more keys only when all keys don’t exist.

PSETEX

Sets both string value and expiration time in milliseconds of a key. The key is created if it doesn’t exist.

  • Documentation: PSETEX

  • Implementation: psetex()

  • Deprecated in redis: 2.6.12. Use set() with the px argument

SET

Sets the string value of a key, ignoring its type. The key is created if it doesn’t exist.

  • Documentation: SET

  • Implementation: set()

SETEX

Sets the string value and expiration time of a key. Creates the key if it doesn’t exist.

  • Documentation: SETEX

  • Implementation: setex()

  • Deprecated in redis: 2.6.12. Use set() with the ex argument

SETNX

Set the string value of a key only when the key doesn’t exist.

  • Documentation: SETNX

  • Implementation: setnx()

  • Deprecated in redis: 2.6.12. Use set() with the nx argument

SETRANGE

Overwrites a part of a string value with another by an offset. Creates the key if it doesn’t exist.

STRLEN

Returns the length of a string value.

  • Documentation: STRLEN

  • Implementation: strlen()

  • Supports client caching: yes

SUBSTR

Returns a substring from a string value.

  • Documentation: SUBSTR

  • Implementation: substr()

  • Deprecated in redis: 2.0.0. Use getrange()

  • Supports client caching: yes

Bitmap

BITCOUNT

Counts the number of set bits (population counting) in a string.

BITFIELD

Performs arbitrary bitfield integer operations on strings.

BITFIELD_RO

Performs arbitrary read-only bitfield integer operations on strings.

BITOP

Performs bitwise operations on multiple strings, and stores the result.

BITPOS

Finds the first set (1) or clear (0) bit in a string.

GETBIT

Returns a bit value by offset.

SETBIT

Sets or clears the bit at offset of the string value. Creates the key if it doesn’t exist.

Hash

HDEL

Deletes one or more fields and their values from a hash. Deletes the hash if no fields remain.

HEXISTS

Determines whether a field exists in a hash.

HEXPIRE

Set expiry for hash field using relative time to expire (seconds)

  • Documentation: HEXPIRE

  • Implementation: hexpire()

  • New in redis: 7.4.0

  • Added in version 4.18.0.

HEXPIREAT

Set expiry for hash field using an absolute Unix timestamp (seconds)

HEXPIRETIME

Returns the expiration time of a hash field as a Unix timestamp, in seconds.

HGET

Returns the value of a field in a hash.

  • Documentation: HGET

  • Implementation: hget()

  • Supports client caching: yes

HGETALL

Returns all fields and values in a hash.

HINCRBY

Increments the integer value of a field in a hash by a number. Uses 0 as initial value if the field doesn’t exist.

HINCRBYFLOAT

Increments the floating point value of a field by a number. Uses 0 as initial value if the field doesn’t exist.

HKEYS

Returns all fields in a hash.

  • Documentation: HKEYS

  • Implementation: hkeys()

  • Supports client caching: yes

HLEN

Returns the number of fields in a hash.

  • Documentation: HLEN

  • Implementation: hlen()

  • Supports client caching: yes

HMGET

Returns the values of all fields in a hash.

  • Documentation: HMGET

  • Implementation: hmget()

  • Supports client caching: yes

HMSET

Sets the values of multiple fields.

  • Documentation: HMSET

  • Implementation: hmset()

  • Deprecated in redis: 4.0.0. Use hset() with multiple field-value pairs

HPEXPIRE

Set expiry for hash field using relative time to expire (milliseconds)

  • Documentation: HPEXPIRE

  • Implementation: hpexpire()

  • New in redis: 7.4.0

  • Added in version 4.18.0.

HPEXPIREAT

Set expiry for hash field using an absolute Unix timestamp (milliseconds)

HPEXPIRETIME

Returns the expiration time of a hash field as a Unix timestamp, in msec.

HPTTL

Returns the TTL in milliseconds of a hash field.

  • Documentation: HPTTL

  • Implementation: hpttl()

  • New in redis: 7.4.0

  • Added in version 4.18.0.

HRANDFIELD

Returns one or more random fields from a hash.

HSCAN

Iterates over fields and values of a hash.

HSET

Creates or modifies the value of a field in a hash.

HSETNX

Sets the value of a field in a hash only when the field doesn’t exist.

HSTRLEN

Returns the length of the value of a field.

HTTL

Returns the TTL in seconds of a hash field.

  • Documentation: HTTL

  • Implementation: httl()

  • New in redis: 7.4.0

  • Added in version 4.18.0.

HVALS

Returns all values in a hash.

  • Documentation: HVALS

  • Implementation: hvals()

  • Supports client caching: yes

HPERSIST [X]

Removes the expiration time for each specified field

  • Documentation: HPERSIST

  • Not Implemented

List

BLMOVE

Pops an element from a list, pushes it to another list and returns it. Blocks until an element is available otherwise. Deletes the list if the last element was moved.

BLMPOP

Pops the first element from one of multiple lists. Blocks until an element is available otherwise. Deletes the list if the last element was popped.

  • Documentation: BLMPOP

  • Implementation: blmpop()

  • New in redis: 7.0.0

  • Added in version 3.0.0.

BLPOP

Removes and returns the first element in a list. Blocks until an element is available otherwise. Deletes the list if the last element was popped.

BRPOP

Removes and returns the last element in a list. Blocks until an element is available otherwise. Deletes the list if the last element was popped.

BRPOPLPUSH

Pops an element from a list, pushes it to another list and returns it. Block until an element is available otherwise. Deletes the list if the last element was popped.

LINDEX

Returns an element from a list by its index.

  • Documentation: LINDEX

  • Implementation: lindex()

  • Supports client caching: yes

LINSERT

Inserts an element before or after another element in a list.

LLEN

Returns the length of a list.

  • Documentation: LLEN

  • Implementation: llen()

  • Supports client caching: yes

LMOVE

Returns an element after popping it from one list and pushing it to another. Deletes the list if the last element was moved.

  • Documentation: LMOVE

  • Implementation: lmove()

  • New in redis: 6.2.0

LMPOP

Returns multiple elements from a list after removing them. Deletes the list if the last element was popped.

  • Documentation: LMPOP

  • Implementation: lmpop()

  • New in redis: 7.0.0

  • Added in version 3.0.0.

LPOP

Returns the first elements in a list after removing it. Deletes the list if the last element was popped.

LPOS

Returns the index of matching elements in a list.

  • Documentation: LPOS

  • Implementation: lpos()

  • New in redis: 6.0.6

  • Supports client caching: yes

LPUSH

Prepends one or more elements to a list. Creates the key if it doesn’t exist.

LPUSHX

Prepends one or more elements to a list only when the list exists.

LRANGE

Returns a range of elements from a list.

  • Documentation: LRANGE

  • Implementation: lrange()

  • Supports client caching: yes

LREM

Removes elements from a list. Deletes the list if the last element was removed.

LSET

Sets the value of an element in a list by its index.

LTRIM

Removes elements from both ends a list. Deletes the list if all elements were trimmed.

RPOP

Returns and removes the last elements of a list. Deletes the list if the last element was popped.

RPOPLPUSH

Returns the last element of a list after removing and pushing it to another list. Deletes the list if the last element was popped.

RPUSH

Appends one or more elements to a list. Creates the key if it doesn’t exist.

RPUSHX

Appends an element to a list only when the list exists.

Set

SADD

Adds one or more members to a set. Creates the key if it doesn’t exist.

SCARD

Returns the number of members in a set.

  • Documentation: SCARD

  • Implementation: scard()

  • Supports client caching: yes

SDIFF

Returns the difference of multiple sets.

SDIFFSTORE

Stores the difference of multiple sets in a key.

SINTER

Returns the intersect of multiple sets.

SINTERCARD

Returns the number of members of the intersect of multiple sets.

SINTERSTORE

Stores the intersect of multiple sets in a key.

SISMEMBER

Determines whether a member belongs to a set.

SMEMBERS

Returns all members of a set.

SMISMEMBER

Determines whether multiple members belong to a set.

SMOVE

Moves a member from one set to another.

SPOP

Returns one or more random members from a set after removing them. Deletes the set if the last member was popped.

SRANDMEMBER

Get one or multiple random members from a set

SREM

Removes one or more members from a set. Deletes the set if the last member was removed.

SSCAN

Iterates over members of a set.

SUNION

Returns the union of multiple sets.

SUNIONSTORE

Stores the union of multiple sets in a key.

Sorted-Set

BZMPOP

Removes and returns a member by score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped.

  • Documentation: BZMPOP

  • Implementation: bzmpop()

  • New in redis: 7.0.0

  • Added in version 3.0.0.

BZPOPMAX

Removes and returns the member with the highest score from one or more sorted sets. Blocks until a member available otherwise. Deletes the sorted set if the last element was popped.

BZPOPMIN

Removes and returns the member with the lowest score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped.

ZADD

Adds one or more members to a sorted set, or updates their scores. Creates the key if it doesn’t exist.

ZCARD

Returns the number of members in a sorted set.

ZCOUNT

Returns the count of members in a sorted set that have scores within a range.

ZDIFF

Returns the difference between multiple sorted sets.

  • Documentation: ZDIFF

  • Implementation: zdiff()

  • New in redis: 6.2.0

ZDIFFSTORE

Stores the difference of multiple sorted sets in a key.

ZINCRBY

Increments the score of a member in a sorted set.

ZINTER

Returns the intersect of multiple sorted sets.

ZINTERCARD

Returns the number of members of the intersect of multiple sorted sets.

ZINTERSTORE

Stores the intersect of multiple sorted sets in a key.

ZLEXCOUNT

Returns the number of members in a sorted set within a lexicographical range.

ZMPOP

Returns the highest- or lowest-scoring members from one or more sorted sets after removing them. Deletes the sorted set if the last member was popped.

  • Documentation: ZMPOP

  • Implementation: zmpop()

  • New in redis: 7.0.0

  • Added in version 3.0.0.

ZMSCORE

Returns the score of one or more members in a sorted set.

  • Documentation: ZMSCORE

  • Implementation: zmscore()

  • New in redis: 6.2.0

  • Supports client caching: yes

ZPOPMAX

Returns the highest-scoring members from a sorted set after removing them. Deletes the sorted set if the last member was popped.

ZPOPMIN

Returns the lowest-scoring members from a sorted set after removing them. Deletes the sorted set if the last member was popped.

ZRANDMEMBER

Returns one or more random members from a sorted set.

ZRANGE

Returns members in a sorted set within a range of indexes.

  • Documentation: ZRANGE

  • Implementation: zrange()

  • Supports client caching: yes

ZRANGEBYLEX

Returns members in a sorted set within a lexicographical range.

ZRANGEBYSCORE

Returns members in a sorted set within a range of scores.

ZRANGESTORE

Stores a range of members from sorted set in a key.

ZRANK

Returns the index of a member in a sorted set ordered by ascending scores.

  • Documentation: ZRANK

  • Implementation: zrank()

  • Supports client caching: yes

ZREM

Removes one or more members from a sorted set. Deletes the sorted set if all members were removed.

ZREMRANGEBYLEX

Removes members in a sorted set within a lexicographical range. Deletes the sorted set if all members were removed.

ZREMRANGEBYRANK

Removes members in a sorted set within a range of indexes. Deletes the sorted set if all members were removed.

ZREMRANGEBYSCORE

Removes members in a sorted set within a range of scores. Deletes the sorted set if all members were removed.

ZREVRANGE

Returns members in a sorted set within a range of indexes in reverse order.

  • Documentation: ZREVRANGE

  • Implementation: zrevrange()

  • Deprecated in redis: 6.2.0. Use zrange() with the rev argument

  • Supports client caching: yes

ZREVRANGEBYLEX

Returns members in a sorted set within a lexicographical range in reverse order.

ZREVRANGEBYSCORE

Returns members in a sorted set within a range of scores in reverse order.

ZREVRANK

Returns the index of a member in a sorted set ordered by descending scores.

ZSCAN

Iterates over members and scores of a sorted set.

ZSCORE

Returns the score of a member in a sorted set.

  • Documentation: ZSCORE

  • Implementation: zscore()

  • Supports client caching: yes

ZUNION

Returns the union of multiple sorted sets.

ZUNIONSTORE

Stores the union of multiple sorted sets in a key.

Hyperloglog

PFADD

Adds elements to a HyperLogLog key. Creates the key if it doesn’t exist.

PFCOUNT

Returns the approximated cardinality of the set(s) observed by the HyperLogLog key(s).

PFMERGE

Merges one or more HyperLogLog values into a single key.

Geo

GEOADD

Adds one or more members to a geospatial index. The key is created if it doesn’t exist.

GEODIST

Returns the distance between two members of a geospatial index.

GEOHASH

Returns members from a geospatial index as geohash strings.

GEOPOS

Returns the longitude and latitude of members from a geospatial index.

GEORADIUS

Queries a geospatial index for members within a distance from a coordinate, optionally stores the result.

GEORADIUSBYMEMBER

Queries a geospatial index for members within a distance from a member, optionally stores the result.

GEOSEARCH

Queries a geospatial index for members inside an area of a box or a circle.

GEOSEARCHSTORE

Queries a geospatial index for members inside an area of a box or a circle, optionally stores the result.

Stream

XACK

Returns the number of messages that were successfully acknowledged by the consumer group member of a stream.

XADD

Appends a new message to a stream. Creates the key if it doesn’t exist.

XAUTOCLAIM

Changes, or acquires, ownership of messages in a consumer group, as if the messages were delivered to as consumer group member.

XCLAIM

Changes, or acquires, ownership of a message in a consumer group, as if the message was delivered a consumer group member.

XDEL

Returns the number of messages after removing them from a stream.

XGROUP CREATE

Creates a consumer group.

XGROUP CREATECONSUMER

Creates a consumer in a consumer group.

XGROUP DELCONSUMER

Deletes a consumer from a consumer group.

XGROUP DESTROY

Destroys a consumer group.

XGROUP SETID

Sets the last-delivered ID of a consumer group.

XINFO CONSUMERS

Returns a list of the consumers in a consumer group.

XINFO GROUPS

Returns a list of the consumer groups of a stream.

XINFO STREAM

Returns information about a stream.

XLEN

Return the number of messages in a stream.

XPENDING

Returns the information and entries from a stream consumer group’s pending entries list.

XRANGE

Returns the messages from a stream within a range of IDs.

XREAD

Returns messages from multiple streams with IDs greater than the ones requested. Blocks until a message is available otherwise.

XREADGROUP

Returns new or historical messages from a stream for a consumer in a group. Blocks until a message is available otherwise.

XREVRANGE

Returns the messages from a stream within a range of IDs in reverse order.

XTRIM

Deletes messages from the beginning of a stream.

Scripting

EVAL

Executes a server-side Lua script.

EVALSHA

Executes a server-side Lua script by SHA1 digest.

EVALSHA_RO

Executes a read-only server-side Lua script by SHA1 digest.

EVAL_RO

Executes a read-only server-side Lua script.

  • Documentation: EVAL_RO

  • Implementation: eval_ro()

  • New in redis: 7.0.0

  • Added in version 3.0.0.

FCALL

Invokes a function.

  • Documentation: FCALL

  • Implementation: fcall()

  • New in redis: 7.0.0

  • Added in version 3.1.0.

FCALL_RO

Invokes a read-only function.

  • Documentation: FCALL_RO

  • Implementation: fcall_ro()

  • New in redis: 7.0.0

  • Added in version 3.1.0.

FUNCTION DELETE

Deletes a library and its functions.

FUNCTION DUMP

Dumps all libraries into a serialized binary payload.

FUNCTION FLUSH

Deletes all libraries and functions.

FUNCTION KILL

Terminates a function during execution.

FUNCTION LIST

Returns information about all libraries.

FUNCTION LOAD

Creates a library.

FUNCTION RESTORE

Restores all libraries from a payload.

FUNCTION STATS

Returns information about a function during execution.

SCRIPT DEBUG

Sets the debug mode of server-side Lua scripts.

SCRIPT EXISTS

Determines whether server-side Lua scripts exist in the script cache.

SCRIPT FLUSH

Removes all server-side Lua scripts from the script cache.

SCRIPT KILL

Terminates a server-side Lua script during execution.

SCRIPT LOAD

Loads a server-side Lua script to the script cache.

Pubsub

PUBLISH

Posts a message to a channel.

PUBSUB CHANNELS

Returns the active channels.

PUBSUB NUMPAT

Returns a count of unique pattern subscriptions.

PUBSUB NUMSUB

Returns a count of subscribers to channels.

PUBSUB SHARDCHANNELS

Returns the active shard channels.

PUBSUB SHARDNUMSUB

Returns the count of subscribers of shard channels.

SPUBLISH

Post a message to a shard channel

  • Documentation: SPUBLISH

  • Implementation: spublish()

  • New in redis: 7.0.0

  • Added in version 3.6.0.

PSUBSCRIBE [X]

Listens for messages published to channels that match one or more patterns.

PUNSUBSCRIBE [X]

Stops listening to messages published to channels that match one or more patterns.

SSUBSCRIBE [X]

Listens for messages published to shard channels.

SUBSCRIBE [X]

Listens for messages published to channels.

SUNSUBSCRIBE [X]

Stops listening to messages posted to shard channels.

UNSUBSCRIBE [X]

Stops listening to messages posted to channels.

Transactions

DISCARD [X]

Discards a transaction.

  • Documentation: DISCARD

  • Not Implemented

EXEC [X]

Executes all commands in a transaction.

  • Documentation: EXEC

  • Not Implemented

MULTI [X]

Starts a transaction.

  • Documentation: MULTI

  • Not Implemented

UNWATCH [X]

Forgets about watched keys of a transaction.

  • Documentation: UNWATCH

  • Not Implemented

WATCH [X]

Monitors changes to keys to determine the execution of a transaction.

  • Documentation: WATCH

  • Not Implemented

Server

ACL CAT

Lists the ACL categories, or the commands inside a category.

  • Documentation: ACL CAT

  • Implementation: acl_cat()

  • New in redis: 6.0.0

  • Added in version 3.0.0.

ACL DELUSER

Deletes ACL users, and terminates their connections.

ACL DRYRUN

Simulates the execution of a command by a user, without executing the command.

ACL GENPASS

Generates a pseudorandom, secure password that can be used to identify ACL users.

ACL GETUSER

Lists the ACL rules of a user.

ACL LIST

Dumps the effective rules in ACL file format.

  • Documentation: ACL LIST

  • Implementation: acl_list()

  • New in redis: 6.0.0

  • Added in version 3.0.0.

ACL LOAD

Reloads the rules from the configured ACL file.

  • Documentation: ACL LOAD

  • Implementation: acl_load()

  • New in redis: 6.0.0

  • Added in version 3.0.0.

ACL LOG

Lists recent security events generated due to ACL rules.

  • Documentation: ACL LOG

  • Implementation: acl_log()

  • New in redis: 6.0.0

  • Added in version 3.0.0.

ACL SAVE

Saves the effective ACL rules in the configured ACL file.

  • Documentation: ACL SAVE

  • Implementation: acl_save()

  • New in redis: 6.0.0

  • Added in version 3.0.0.

ACL SETUSER

Creates and modifies an ACL user and its rules.

ACL USERS

Lists all ACL users.

ACL WHOAMI

Returns the authenticated username of the current connection.

BGREWRITEAOF

Asynchronously rewrites the append-only file to disk.

BGSAVE

Asynchronously saves the database(s) to disk.

COMMAND

Returns detailed information about all commands.

COMMAND COUNT

Returns a count of commands.

COMMAND DOCS

Returns documentary information about one, multiple or all commands.

COMMAND GETKEYS

Extracts the key names from an arbitrary command.

COMMAND GETKEYSANDFLAGS

Extracts the key names and access flags for an arbitrary command.

COMMAND INFO

Returns information about one, multiple or all commands.

COMMAND LIST

Returns a list of command names.

CONFIG GET

Returns the effective values of configuration parameters.

CONFIG RESETSTAT

Resets the server’s statistics.

CONFIG REWRITE

Persists the effective configuration to file.

CONFIG SET

Sets configuration parameters in-flight.

DBSIZE

Returns the number of keys in the database.

FAILOVER

Starts a coordinated failover from a server to one of its replicas.

  • Documentation: FAILOVER

  • Implementation: failover()

  • New in redis: 6.2.0

  • Added in version 3.0.0.

FLUSHALL

Removes all keys from all databases.

FLUSHDB

Remove all keys from the current database.

INFO

Returns information and statistics about the server.

LASTSAVE

Returns the Unix timestamp of the last successful save to disk.

LATENCY DOCTOR

Returns a human-readable latency analysis report.

LATENCY GRAPH

Returns a latency graph for an event.

LATENCY HISTOGRAM

Returns the cumulative distribution of latencies of a subset or all commands.

LATENCY HISTORY

Returns timestamp-latency samples for an event.

LATENCY LATEST

Returns the latest latency samples for all events.

LATENCY RESET

Resets the latency data for one or more events.

LOLWUT

Displays computer art and the Redis version

MEMORY DOCTOR

Outputs a memory problems report.

MEMORY MALLOC-STATS

Returns the allocator statistics.

MEMORY PURGE

Asks the allocator to release memory.

MEMORY STATS

Returns details about memory usage.

MEMORY USAGE

Estimates the memory usage of a key.

MODULE LIST

Returns all loaded modules.

MODULE LOAD

Loads a module.

MODULE LOADEX

Loads a module using extended parameters.

MODULE UNLOAD

Unloads a module.

MONITOR

Listens for all requests received by the server in real-time.

REPLICAOF

Configures a server as replica of another, or promotes it to a master.

ROLE

Returns the replication role.

SAVE

Synchronously saves the database(s) to disk.

SHUTDOWN

Synchronously saves the database(s) to disk and shuts down the Redis server.

SLAVEOF

Sets a Redis server as a replica of another, or promotes it to being a master.

SLOWLOG GET

Returns the slow log’s entries.

SLOWLOG LEN

Returns the number of entries in the slow log.

SLOWLOG RESET

Clears all entries from the slow log.

SWAPDB

Swaps two Redis databases.

  • Documentation: SWAPDB

  • Implementation: swapdb()

  • Added in version 3.0.0.

TIME

Returns the server time.

Connection

AUTH

Authenticates the connection.

  • Documentation: AUTH

  • Implementation: auth()

    Warning

    Using auth() directly is not recommended. Use the Redis.username and Redis.password arguments when initializing the client to ensure that all connections originating from this client are authenticated before being made available.

  • Added in version 3.0.0.

CLIENT CACHING

Instructs the server whether to track the keys in the next request.

CLIENT GETNAME

Returns the name of the connection.

CLIENT GETREDIR

Returns the client ID to which the connection’s tracking notifications are redirected.

CLIENT ID

Returns the unique client ID of the connection.

CLIENT INFO

Returns information about the connection.

CLIENT KILL

Terminates open connections.

CLIENT LIST

Lists open connections.

CLIENT NO-EVICT

Sets the client eviction mode of the connection.

CLIENT NO-TOUCH

Controls whether commands sent by the client affect the LRU/LFU of accessed keys.

CLIENT PAUSE

Suspends commands processing.

CLIENT REPLY

Instructs the server whether to reply to commands.

  • Documentation: CLIENT REPLY

  • Danger

    client_reply() intentionally raises an NotImplemented error. Use the Redis.noreply argument when initializing the client to ensure that all connections originating from this client disable or enable replies. You can also use the Redis.ignore_replies() context manager to selectively execute certain commands without waiting for a reply

  • Added in version 3.0.0.

CLIENT SETINFO

Sets information specific to the client or connection.

  • Documentation: CLIENT SETINFO

  • Implementation: client_setinfo()

    Warning

    Using client_setinfo() directly is not recommended. Coredis sets the library name and version by default during the handshake phase.Explicitly calling this command will only apply to the connection from the pool that was used to send it and not for subsequent commands

  • New in redis: 7.2.0

  • Added in version 4.12.0.

CLIENT SETNAME

Sets the connection name.

CLIENT TRACKING

Controls server-assisted client-side caching for the connection.

CLIENT TRACKINGINFO

Returns information about server-assisted client-side caching for the connection.

CLIENT UNBLOCK

Unblocks a client blocked by a blocking command from a different connection.

CLIENT UNPAUSE

Resumes processing commands from paused clients.

ECHO

Returns the given string.

HELLO

Handshakes with the Redis server.

  • Documentation: HELLO

  • Implementation: hello()

  • New in redis: 6.0.0

  • Added in version 3.0.0.

PING

Returns the server’s liveliness response.

QUIT

Closes the connection.

  • Documentation: QUIT

  • Implementation: quit()

  • Deprecated in redis: 7.2.0. Use just closing the connection

RESET

Resets the connection.

  • Documentation: RESET

  • Implementation: reset()

  • New in redis: 6.2.0

  • Added in version 3.0.0.

SELECT

Changes the selected database.

  • Documentation: SELECT

  • Implementation: select()

    Warning

    Using select() directly is not recommended. Use the db argument when initializing the client to ensure that all connections originating from this client use the desired database number

  • Added in version 3.0.0.

Cluster

ASKING

Signals that a cluster client is following an -ASK redirect.

  • Documentation: ASKING

  • Implementation: asking()

  • Added in version 3.0.0.

CLUSTER ADDSLOTS

Assigns new hash slots to a node.

CLUSTER ADDSLOTSRANGE

Assigns new hash slot ranges to a node.

CLUSTER BUMPEPOCH

Advances the cluster config epoch.

CLUSTER COUNT-FAILURE-REPORTS

Returns the number of active failure reports active for a node.

CLUSTER COUNTKEYSINSLOT

Returns the number of keys in a hash slot.

CLUSTER DELSLOTS

Sets hash slots as unbound for a node.

CLUSTER DELSLOTSRANGE

Sets hash slot ranges as unbound for a node.

CLUSTER FAILOVER

Forces a replica to perform a manual failover of its master.

CLUSTER FLUSHSLOTS

Deletes all slots information from a node.

CLUSTER FORGET

Removes a node from the nodes table.

CLUSTER GETKEYSINSLOT

Returns the key names in a hash slot.

CLUSTER INFO

Returns information about the state of a node.

CLUSTER KEYSLOT

Returns the hash slot for a key.

CLUSTER MEET

Forces a node to handshake with another node.

CLUSTER MYID

Returns the ID of a node.

CLUSTER NODES

Returns the cluster configuration for a node.

CLUSTER REPLICAS

Lists the replica nodes of a master node.

CLUSTER REPLICATE

Configure a node as replica of a master node.

CLUSTER RESET

Resets a node.

CLUSTER SAVECONFIG

Forces a node to save the cluster configuration to disk.

CLUSTER SET-CONFIG-EPOCH

Sets the configuration epoch for a new node.

CLUSTER SETSLOT

Binds a hash slot to a node.

CLUSTER SHARDS

Returns the mapping of cluster slots to shards.

CLUSTER SLAVES

Lists the replica nodes of a master node.

CLUSTER SLOTS

Returns the mapping of cluster slots to nodes.

READONLY

Enables read-only queries for a connection to a Redis Cluster replica node.

READWRITE

Enables read-write queries for a connection to a Reids Cluster replica node.

CLUSTER MYSHARDID [X]

Returns the shard ID of a node.