Command reference #
The following commands are available in Redict.
Bitmap commands
-
BITCOUNT
Counts the number of set bits (population …
-
BITFIELD
Performs arbitrary bitfield integer operations on …
-
BITFIELD_RO
Performs arbitrary read-only bitfield integer …
-
BITOP
Performs bitwise operations on multiple strings, …
-
BITPOS
Finds the first set (1) or clear (0) bit in a …
-
GETBIT
Returns a bit value by offset.
-
SETBIT
Sets or clears the bit at offset of the string …
Cluster management commands
-
ASKING
Signals that a cluster client is following an -ASK …
-
CLUSTER
A container for Redict Cluster commands.
-
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 …
-
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 …
-
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 HELP
Returns helpful text about the different …
-
CLUSTER INFO
Returns information about the state of a node.
-
CLUSTER KEYSLOT
Returns the hash slot for a key.
-
CLUSTER LINKS
Returns a list of all TCP links to and from peer …
-
CLUSTER MEET
Forces a node to handshake with another node.
-
CLUSTER MYID
Returns the ID of a node.
-
CLUSTER MYSHARDID
Returns the shard 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 …
-
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 …
-
READWRITE
Enables read-write queries for a connection to a …
Generic commands
-
COPY
Copies the value of a key to a new key.
-
DEL
Deletes one or more keys.
-
DUMP
Returns a serialized representation of the value …
-
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 …
-
EXPIRETIME
Returns the expiration time of a key as a Unix …
-
KEYS
Returns all key names that match a pattern.
-
MIGRATE
Atomically transfers a key from one Redict …
-
MOVE
Moves a key to another database.
-
OBJECT
A container for object introspection commands.
-
OBJECT ENCODING
Returns the internal encoding of a Redict object.
-
OBJECT FREQ
Returns the logarithmic access frequency counter …
-
OBJECT HELP
Returns helpful text about the different …
-
OBJECT IDLETIME
Returns the time since the last access to a Redict …
-
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 …
-
PEXPIRETIME
Returns the expiration time of a key as a Unix …
-
PTTL
Returns the expiration time in milliseconds of a …
-
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 …
-
RESTORE
Creates a key from the serialized representation …
-
SCAN
Iterates over the key names in the database.
-
SORT
Sorts the elements in a list, a set, or a sorted …
-
SORT_RO
Returns the sorted elements of a list, a set, or a …
-
TOUCH
Returns the number of existing keys out of those …
-
TTL
Returns the expiration time in seconds of a key.
-
TYPE
Determines the type of value stored at a key.
-
UNLINK
Asynchronously deletes one or more keys.
-
WAIT
Blocks until the asynchronous replication of all …
-
WAITAOF
Blocks until all of the preceding write commands …
Geospatial commands
-
GEOADD
Adds one or more members to a geospatial index. …
-
GEODIST
Returns the distance between two members of a …
-
GEOHASH
Returns members from a geospatial index as geohash …
-
GEOPOS
Returns the longitude and latitude of members from …
-
GEORADIUS
Queries a geospatial index for members within a …
-
GEORADIUSBYMEMBER
Queries a geospatial index for members within a …
-
GEORADIUSBYMEMBER_RO
Returns members from a geospatial index that are …
-
GEORADIUS_RO
Returns members from a geospatial index that are …
-
GEOSEARCH
Queries a geospatial index for members inside an …
-
GEOSEARCHSTORE
Queries a geospatial index for members inside an …
Hash commands
-
HDEL
Deletes one or more fields and their values from a …
-
HEXISTS
Determines whether a field exists in a hash.
-
HGET
Returns the value of a field in a hash.
-
HGETALL
Returns all fields and values in a hash.
-
HINCRBY
Increments the integer value of a field in a hash …
-
HINCRBYFLOAT
Increments the floating point value of a field by …
-
HKEYS
Returns all fields in a hash.
-
HLEN
Returns the number of fields in a hash.
-
HMGET
Returns the values of all fields in a hash.
-
HMSET
Sets the values of multiple fields.
-
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 …
-
HSETNX
Sets the value of a field in a hash only when the …
-
HSTRLEN
Returns the length of the value of a field.
-
HVALS
Returns all values in a hash.
HyperLogLog commands
List commands
-
BLMOVE
Pops an element from a list, pushes it to another …
-
BLMPOP
Pops the first element from one of multiple lists. …
-
BLPOP
Removes and returns the first element in a list. …
-
BRPOP
Removes and returns the last element in a list. …
-
BRPOPLPUSH
Pops an element from a list, pushes it to another …
-
LINDEX
Returns an element from a list by its index.
-
LINSERT
Inserts an element before or after another element …
-
LLEN
Returns the length of a list.
-
LMOVE
Returns an element after popping it from one list …
-
LMPOP
Returns multiple elements from a list after …
-
LPOP
Returns the first elements in a list after …
-
LPOS
Returns the index of matching elements in a list.
-
LPUSH
Prepends one or more elements to a list. Creates …
-
LPUSHX
Prepends one or more elements to a list only when …
-
LRANGE
Returns a range of elements from a list.
-
LREM
Removes elements from a list. Deletes the list if …
-
LSET
Sets the value of an element in a list by its …
-
LTRIM
Removes elements from both ends a list. Deletes …
-
RPOP
Returns and removes the last elements of a list. …
-
RPOPLPUSH
Returns the last element of a list after removing …
-
RPUSH
Appends one or more elements to a list. Creates …
-
RPUSHX
Appends an element to a list only when the list …
Pub/sub commands
-
PSUBSCRIBE
Listens for messages published to channels that …
-
PUBLISH
Posts a message to a channel.
-
PUBSUB
A container for Pub/Sub commands.
-
PUBSUB CHANNELS
Returns the active channels.
-
PUBSUB HELP
Returns helpful text about the different …
-
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 …
-
PUNSUBSCRIBE
Stops listening to messages published to channels …
-
SPUBLISH
Post a message to a shard channel
-
SSUBSCRIBE
Listens for messages published to shard channels.
-
SUBSCRIBE
Listens for messages published to channels.
-
SUNSUBSCRIBE
Stops listening to messages posted to shard …
-
UNSUBSCRIBE
Stops listening to messages posted to channels.
Scripting commands
-
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 …
-
EVAL_RO
Executes a read-only server-side Lua script.
-
FCALL
Invokes a function.
-
FCALL_RO
Invokes a read-only function.
-
FUNCTION
A container for function commands.
-
FUNCTION DELETE
Deletes a library and its functions.
-
FUNCTION DUMP
Dumps all libraries into a serialized binary …
-
FUNCTION FLUSH
Deletes all libraries and functions.
-
FUNCTION HELP
Returns helpful text about the different …
-
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 …
-
SCRIPT
A container for Lua scripts management commands.
-
SCRIPT DEBUG
Sets the debug mode of server-side Lua scripts.
-
SCRIPT EXISTS
Determines whether server-side Lua scripts exist …
-
SCRIPT FLUSH
Removes all server-side Lua scripts from the …
-
SCRIPT HELP
Returns helpful text about the different …
-
SCRIPT KILL
Terminates a server-side Lua script during …
-
SCRIPT LOAD
Loads a server-side Lua script to the script …
Server management commands
-
ACL
A container for Access List Control commands.
-
ACL CAT
Lists the ACL categories, or the commands inside a …
-
ACL DELUSER
Deletes ACL users, and terminates their …
-
ACL DRYRUN
Simulates the execution of a command by a user, …
-
ACL GENPASS
Generates a pseudorandom, secure password that can …
-
ACL GETUSER
Lists the ACL rules of a user.
-
ACL HELP
Returns helpful text about the different …
-
ACL LIST
Dumps the effective rules in ACL file format.
-
ACL LOAD
Reloads the rules from the configured ACL file.
-
ACL LOG
Lists recent security events generated due to ACL …
-
ACL SAVE
Saves the effective ACL rules in the configured …
-
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 …
-
BGREWRITEAOF
Asynchronously rewrites the append-only file to …
-
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, …
-
COMMAND GETKEYS
Extracts the key names from an arbitrary command.
-
COMMAND GETKEYSANDFLAGS
Extracts the key names and access flags for an …
-
COMMAND HELP
Returns helpful text about the different …
-
COMMAND INFO
Returns information about one, multiple or all …
-
COMMAND LIST
Returns a list of command names.
-
CONFIG
A container for server configuration commands.
-
CONFIG GET
Returns the effective values of configuration …
-
CONFIG HELP
Returns helpful text about the different …
-
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.
-
DEBUG
A container for debugging commands.
-
FAILOVER
Starts a coordinated failover from a server to one …
-
FLUSHALL
Removes all keys from all databases.
-
FLUSHDB
Remove all keys from the current database.
-
INFO
Returns information and statistics about the …
-
LASTSAVE
Returns the Unix timestamp of the last successful …
-
LATENCY
A container for latency diagnostics commands.
-
LATENCY DOCTOR
Returns a human-readable latency analysis report.
-
LATENCY GRAPH
Returns a latency graph for an event.
-
LATENCY HELP
Returns helpful text about the different …
-
LATENCY HISTOGRAM
Returns the cumulative distribution of latencies …
-
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 Redict version
-
MEMORY
A container for memory diagnostics commands.
-
MEMORY DOCTOR
Outputs a memory problems report.
-
MEMORY HELP
Returns helpful text about the different …
-
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
A container for module commands.
-
MODULE HELP
Returns helpful text about the different …
-
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 …
-
PSYNC
An internal command used in replication.
-
REPLCONF
An internal command for configuring the …
-
REPLICAOF
Configures a server as replica of another, or …
-
RESTORE-ASKING
An internal command for migrating keys in a …
-
ROLE
Returns the replication role.
-
SAVE
Synchronously saves the database(s) to disk.
-
SHUTDOWN
Synchronously saves the database(s) to disk and …
-
SLAVEOF
Sets a Redict server as a replica of another, or …
-
SLOWLOG
A container for slow log commands.
-
SLOWLOG GET
Returns the slow log's entries.
-
SLOWLOG HELP
Show helpful text about the different subcommands
-
SLOWLOG LEN
Returns the number of entries in the slow log.
-
SLOWLOG RESET
Clears all entries from the slow log.
-
SWAPDB
Swaps two Redict databases.
-
SYNC
An internal command used in replication.
-
TIME
Returns the server time.
Set commands
-
SADD
Adds one or more members to a set. Creates the key …
-
SCARD
Returns the number of members in a set.
-
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 …
-
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 …
-
SMOVE
Moves a member from one set to another.
-
SPOP
Returns one or more random members from a set …
-
SRANDMEMBER
Get one or multiple random members from a set
-
SREM
Removes one or more members from a set. Deletes …
-
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 commands
-
BZMPOP
Removes and returns a member by score from one or …
-
BZPOPMAX
Removes and returns the member with the highest …
-
BZPOPMIN
Removes and returns the member with the lowest …
-
ZADD
Adds one or more members to a sorted set, or …
-
ZCARD
Returns the number of members in a sorted set.
-
ZCOUNT
Returns the count of members in a sorted set that …
-
ZDIFF
Returns the difference between multiple sorted …
-
ZDIFFSTORE
Stores the difference of multiple sorted sets in a …
-
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 …
-
ZINTERSTORE
Stores the intersect of multiple sorted sets in a …
-
ZLEXCOUNT
Returns the number of members in a sorted set …
-
ZMPOP
Returns the highest- or lowest-scoring members …
-
ZMSCORE
Returns the score of one or more members in a …
-
ZPOPMAX
Returns the highest-scoring members from a sorted …
-
ZPOPMIN
Returns the lowest-scoring members from a sorted …
-
ZRANDMEMBER
Returns one or more random members from a sorted …
-
ZRANGE
Returns members in a sorted set within a range of …
-
ZRANGEBYLEX
Returns members in a sorted set within a …
-
ZRANGEBYSCORE
Returns members in a sorted set within a range of …
-
ZRANGESTORE
Stores a range of members from sorted set in a …
-
ZRANK
Returns the index of a member in a sorted set …
-
ZREM
Removes one or more members from a sorted set. …
-
ZREMRANGEBYLEX
Removes members in a sorted set within a …
-
ZREMRANGEBYRANK
Removes members in a sorted set within a range of …
-
ZREMRANGEBYSCORE
Removes members in a sorted set within a range of …
-
ZREVRANGE
Returns members in a sorted set within a range of …
-
ZREVRANGEBYLEX
Returns members in a sorted set within a …
-
ZREVRANGEBYSCORE
Returns members in a sorted set within a range of …
-
ZREVRANK
Returns the index of a member in a sorted set …
-
ZSCAN
Iterates over members and scores of a sorted set.
-
ZSCORE
Returns the score of a member in a sorted set.
-
ZUNION
Returns the union of multiple sorted sets.
-
ZUNIONSTORE
Stores the union of multiple sorted sets in a key.
Stream commands
-
XACK
Returns the number of messages that were …
-
XADD
Appends a new message to a stream. Creates the key …
-
XAUTOCLAIM
Changes, or acquires, ownership of messages in a …
-
XCLAIM
Changes, or acquires, ownership of a message in a …
-
XDEL
Returns the number of messages after removing them …
-
XGROUP
A container for consumer groups commands.
-
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 HELP
Returns helpful text about the different …
-
XGROUP SETID
Sets the last-delivered ID of a consumer group.
-
XINFO
A container for stream introspection commands.
-
XINFO CONSUMERS
Returns a list of the consumers in a consumer …
-
XINFO GROUPS
Returns a list of the consumer groups of a stream.
-
XINFO HELP
Returns helpful text about the different …
-
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 …
-
XRANGE
Returns the messages from a stream within a range …
-
XREAD
Returns messages from multiple streams with IDs …
-
XREADGROUP
Returns new or historical messages from a stream …
-
XREVRANGE
Returns the messages from a stream within a range …
-
XSETID
An internal command for replicating stream values.
-
XTRIM
Deletes messages from the beginning of a stream.
String commands
-
APPEND
Appends a string to the value of a key. Creates …
-
DECR
Decrements the integer value of a key by one. Uses …
-
DECRBY
Decrements a number from the integer value of a …
-
GET
Returns the string value of a key.
-
GETDEL
Returns the string value of a key after deleting …
-
GETEX
Returns the string value of a key after setting …
-
GETRANGE
Returns a substring of the string stored at a key.
-
GETSET
Returns the previous string value of a key after …
-
INCR
Increments the integer value of a key by one. Uses …
-
INCRBY
Increments the integer value of a key by a number. …
-
INCRBYFLOAT
Increment the floating point value of a key by a …
-
LCS
Finds the longest common substring.
-
MGET
Atomically returns the string values of one or …
-
MSET
Atomically creates or modifies the string values …
-
MSETNX
Atomically modifies the string values of one or …
-
PSETEX
Sets both string value and expiration time in …
-
SET
Sets the string value of a key, ignoring its type. …
-
SETEX
Sets the string value and expiration time of a …
-
SETNX
Set the string value of a key only when the key …
-
SETRANGE
Overwrites a part of a string value with another …
-
STRLEN
Returns the length of a string value.
-
SUBSTR
Returns a substring from a string value.