Command reference
Every command KiviDB 1.2.2 has (538, subcommands included), by group, with a page each: syntax, what it does, the reply, examples, and where KiviDB differs from Redis.
ACLArraysBitmapsClusterGeospatialHashesHyperLogLogJSONKeysListsObservabilityOtherPub/SubScriptingSearchServerSetsSorted setsStreamsStringsTime seriesTransactionsVector sets
ACL
| Command | Summary |
|---|---|
ACL | Manages users and what each may do: which commands it may run, which keys it may read or write, which channels it may use. Subcommands: CAT, DELUSER, DRYRUN, GENPASS, GETUSER, HELP, LIST, LOAD, LOG, SAVE, SETUSER, USERS, WHOAMI. |
AUTH | Logs the connection in as a user: AUTH username password, or, with a password only, as the default user. |
Arrays
| Command | Summary |
|---|---|
ARCOUNT | Returns the number of filled slots in the array at key. |
ARDEL | Empties the slots at the given indexes in the array at key. |
ARDELRANGE | Empties every slot from start to end, both included, in the array at key, for one or more ranges. |
ARGET | Returns the value at index in the array at key. |
ARGETRANGE | Returns every slot from start to end, both included, nil for empty ones. |
ARGREP | Returns the indexes of the slots from start to end whose values match. |
ARINFO | Returns the array's filled slots (count), its len, the insert cursor (next-insert-index), and how it is laid out in memory: its slices of slice-size slots, and the directories that find them. |
ARINSERT | Writes values at the array's insert cursor, moving the cursor on one slot per value. |
ARLASTITEMS | Returns the count slots before the insert cursor, oldest first, or newest first with REV, nil for empty ones. |
ARLEN | Returns the highest filled index plus one; 0 for a missing key. |
ARMGET | Returns the values at several indexes in the array at key, in one call. |
ARMSET | Sets values at several indexes in the array at key, in one call. |
ARNEXT | Returns the index the next ARINSERT on the array at key will write to. |
AROP | Computes over the filled slots from start to end. |
ARRING | Writes values into a ring buffer of size slots: the cursor wraps around at size, so newer values overwrite the oldest. |
ARSCAN | Returns the filled slots from start to end, skipping empty ones, as [index, value] pairs; in reverse with start greater than end. |
ARSEEK | Moves the insert cursor of the array at key to index, so the next ARINSERT writes there. |
ARSET | Sets values in the array at key from index on, one slot each. |
Bitmaps
| Command | Summary |
|---|---|
BITCOUNT | Counts the bits set to 1 in the string at key, or in a part of it. |
BITFIELD | Reads, writes and increments integers of any width from 1 to 64 bits, stored at any bit offset of the string at key, in one command. |
BITFIELD_RO | BITFIELD with GET only: it only reads, so it can be sent to a read-only replica. |
BITOP | Combines the strings at the source keys bit by bit and stores the result at destkey. |
BITPOS | Returns the position of the first bit set to bit (0 or 1) in the string at key, or in a part of it. |
GETBIT | Returns the bit at offset in the string at key. |
SETBIT | Sets or clears the bit at offset in the string at key. |
Cluster
| Command | Summary |
|---|---|
ASKING | Lets the connection's next command use a slot this node is importing (CLUSTER SETSLOT ... IMPORTING) but does not own yet. |
CLUSTER | Manages a cluster node: which slots it owns, which nodes it knows, its replicas, and the moving of slots between masters. Subcommands: ADDSLOTS, ADDSLOTSRANGE, BUMPEPOCH, COUNT-FAILURE-REPORTS, COUNTKEYSINSLOT, DELSLOTS, DELSLOTSRANGE, FAILOVER, FLUSHSLOTS, FORGET, GETKEYSINSLOT, HELP, INFO, KEYSLOT, LINKS, MEET, MIGRATION, MYID, MYSHARDID, NODES, REPLICAS, REPLICATE, RESET, SAVECONFIG, SET-CONFIG-EPOCH, SETSLOT, SHARDS, SLAVES, SLOT-STATS, SLOTS. |
MIGRATE | Moves keys to another server: each is serialised, restored on the server at host port in database db, with its time to live, and deleted here once the other server has acknowledged it. |
READONLY | Lets the connection read from this replica: read commands for the slots of its master are served here, instead of being answered with MOVED. |
READWRITE | Turns off READONLY for the connection. |
Geospatial
| Command | Summary |
|---|---|
GEOADD | Adds places, each a longitude, a latitude and a name, to the geospatial index at key: a sorted set whose scores encode positions, so that it can be searched by distance. |
GEODIST | Returns the distance between two members of the geospatial index at key, in metres, or in KM, FT or MI. |
GEOHASH | Returns the geohash of members of the geospatial index at key: the standard 11-character base32 string, which other geohash tools read. |
GEOPOS | Returns the longitude and latitude of members of the geospatial index at key. |
GEORADIUS | Returns the members of the geospatial index at key within radius of a longitude and latitude. |
GEORADIUS_RO | Returns the members of the geospatial index at key within radius of a longitude and latitude, as GEORADIUS does, but without its STORE and STOREDIST options: it only reads. |
GEORADIUSBYMEMBER | GEORADIUS centred on a member of the index, not a position. |
GEORADIUSBYMEMBER_RO | Returns the members of the geospatial index at key within radius of one of its members, as GEORADIUSBYMEMBER does, but without its STORE and STOREDIST options: it only reads, and its command flags sa… |
GEOSEARCH | Returns the members of the geospatial index at key within a circle or a box. |
GEOSEARCHSTORE | Stores the members GEOSEARCH would return at destination. |
Hashes
| Command | Summary |
|---|---|
HDEL | Deletes fields from the hash at key. |
HEXISTS | Tells whether field exists in the hash at key. |
HEXPIRE | Makes fields of the hash at key expire after seconds. |
HEXPIREAT | Makes fields of the hash at key expire at a Unix time, in seconds. |
HEXPIRETIME | Returns the Unix time, in seconds, at which fields of the hash at key expire, rounded up to the next second, as in Redis: a field set with HPEXPIREAT h 4102444800001 gives 4102444801. |
HGET | Returns the value of field in the hash at key. |
HGETALL | Returns every field of the hash at key with its value. |
HGETDEL | Returns the values of fields of the hash at key and deletes those fields, in one step. |
HGETEX | Returns the values of fields of the hash at key and, optionally, changes their expiry, in one step. |
HIMPORT | Loads many hashes that have the same fields, without sending the field names for each: a command of Redis 8.10. Subcommands: DISCARD, PREPARE, SET. |
HINCRBY | Adds increment, a 64-bit integer, to the integer value of field in the hash at key. |
HINCRBYFLOAT | Adds increment, a floating-point number, to the value of field in the hash at key. |
HKEYS | Returns the names of all the fields of the hash at key. |
HLEN | Returns the number of fields in the hash at key. |
HMGET | Returns the values of several fields of the hash at key. |
HMSET | Sets fields of the hash at key, each to its value, as HSET does, and replies OK instead of a count. |
HPERSIST | Removes the expiry of fields of the hash at key. |
HPEXPIRE | Makes fields of the hash at key expire after milliseconds. |
HPEXPIREAT | Makes fields of the hash at key expire at a Unix time given in milliseconds. |
HPEXPIRETIME | Returns the Unix time, in milliseconds, at which fields of the hash at key expire. |
HPTTL | Returns how long fields of the hash at key have before they expire, in milliseconds. |
HRANDFIELD | Returns fields of the hash at key, picked at random. |
HSCAN | Goes through the fields of the hash at key a page at a time, as SCAN goes through keys. |
HSET | Sets fields of the hash at key, each to its value. |
HSETEX | Sets fields of the hash at key, with one expiry for all of them, in one step. |
HSETNX | Sets field in the hash at key only if the field does not exist. |
HSTRLEN | Returns the length, in bytes, of the value of field in the hash at key. |
HTTL | Returns how long fields of the hash at key have before they expire, in seconds, rounded up to the next second, as in Redis: a field with 1,499 milliseconds left has 2. |
HVALS | Returns the values of all the fields of the hash at key, without their names. |
HyperLogLog
| Command | Summary |
|---|---|
PFADD | Adds elements to the HyperLogLog at key: a structure of fixed size that estimates how many different elements it has been given, however many that is. |
PFCOUNT | Returns the estimated number of different elements added to the HyperLogLog at key. |
PFDEBUG | Inspects or converts a HyperLogLog. Subcommands: DECODE, ENCODING, GETREG, RESET, TODENSE. |
PFMERGE | Merges the HyperLogLogs at the source keys into destkey, so that it estimates their union. |
PFSELFTEST | Runs KiviDB's checks of its HyperLogLog code and says whether they passed. |
JSON
| Command | Summary |
|---|---|
JSON.ARRAPPEND | Appends one or more values to the end of each array path matches in the JSON document at key. |
JSON.ARRINDEX | Returns the index of the first element equal to value, JSON text, in each array path matches, from start to stop. |
JSON.ARRINSERT | Inserts one or more values into each array path matches, before the element at index. |
JSON.ARRLEN | Returns the number of elements in each array path matches in the JSON document at key. |
JSON.ARRPOP | Removes and returns an element from each array path matches: the last one, or the one at index. |
JSON.ARRTRIM | Keeps only the elements from start to stop, both included, in each array path matches. |
JSON.CLEAR | Resets values in a JSON document without removing them: each array and object path matches is emptied, and each number becomes 0. |
JSON.DEBUG | A container for commands that report on JSON documents rather than read or change them. Subcommands: HELP, MEMORY. |
JSON.DEL | Deletes the values path matches in the JSON document at key. |
JSON.FORGET | Another name for JSON.DEL: it takes the same arguments and gives the same reply. |
JSON.GET | Returns values from the JSON document at key, as JSON text. |
JSON.MERGE | Merges value into each value path matches, as an RFC 7396 merge patch: members are merged into objects, null deletes a member, and anything else replaces. |
JSON.MGET | Evaluates path in the JSON documents at several keys. |
JSON.MSET | Runs JSON.SET for several key, path and value triples in one command. |
JSON.NUMINCRBY | Adds number to each number path matches. |
JSON.NUMMULTBY | Multiplies each number path matches in the JSON document at key by number, and stores the result in place. |
JSON.OBJKEYS | Returns the member names of each object path matches in the JSON document at key. |
JSON.OBJLEN | Returns the number of members in each object path matches in the JSON document at key. |
JSON.RESP | Returns each value path matches in RESP rather than JSON text: null as nil, booleans as true and false, integers as integers, other numbers and strings as bulk strings, an array as [ followed by its… |
JSON.SET | Sets the value at path in the JSON document at key to value, which is JSON text. |
JSON.STRAPPEND | Appends a JSON string to each string path matches. |
JSON.STRLEN | Returns the length of each string path matches in the JSON document at key. |
JSON.TOGGLE | Flips each boolean path matches in the JSON document at key: true becomes false and false becomes true. |
JSON.TYPE | Returns the type of each value path matches: object, array, string, integer, number, boolean or null. |
Keys
| Command | Summary |
|---|---|
COPY | Copies the value at source to destination, with its expiry. |
DEL | Deletes the given keys, whatever their type, and returns how many it deleted. |
DUMP | Serializes the value at key into a payload that RESTORE turns back into the value. |
EXISTS | Returns how many of the given keys exist. |
EXPIRE | Makes key expire after seconds. |
EXPIREAT | Makes key expire at a Unix time, in seconds. |
EXPIRETIME | Returns the Unix time, in seconds, at which key expires, rounded to the nearest second, as in Redis; before 1.2.1 it was rounded down. |
KEYS | Returns every key of the current database that matches a glob-style pattern. |
MOVE | Moves key to database db. |
OBJECT | OBJECT is a container: its subcommands report on a single key's value, and on how the key has been used. Subcommands: ENCODING, FREQ, HELP, IDLETIME, REFCOUNT. |
PERSIST | Removes the expiry of key, so that it is kept until deleted. |
PEXPIRE | Makes key expire after milliseconds. |
PEXPIREAT | Makes key expire at a Unix time, in milliseconds. |
PEXPIRETIME | Returns the Unix time, in milliseconds, at which key expires. |
PTTL | Returns how long key has left before it expires, in milliseconds. |
RANDOMKEY | Returns the name of a key of the current database, picked at random, or nil if the database has no keys. |
RENAME | Renames source to destination, with its expiry. |
RENAMENX | Renames source to destination only if destination does not exist. |
RESTORE | Creates key from a DUMP payload. |
SCAN | Goes through the keys of the current database a page at a time. |
SORT | Sorts the elements of a list, set or sorted set, as numbers unless ALPHA is given. |
SORT_RO | SORT without STORE: it only reads, so it can be sent to a read-only replica. |
SWAPDB | Swaps the contents of two databases in one step: every key, with its value and its time to live, moves from db1 to db2 and the other way round. |
TOUCH | Marks the given keys as used, and returns how many of them exist. |
TTL | Returns how long key has before it expires, in seconds, rounded to the nearest second, as in Redis: a key with 1,499 milliseconds left has 1. |
TYPE | Returns the type of the value at key. |
UNLINK | Deletes the given keys, like DEL, but frees large values in the background. |
Lists
| Command | Summary |
|---|---|
BLMOVE | Moves an element from one list to another in one step, waiting for one if source is empty. |
BLMOVEM | LMOVEM that waits until source has an element, or, with EXACTLY, enough of them, or until timeout seconds have passed. |
BLMPOP | LMPOP that waits until one of the lists has an element, or timeout seconds have passed. |
BLPOP | Pops the first element of the first non-empty list of those given. |
BRPOP | Pops the last element of the first non-empty list among the keys given. |
BRPOPLPUSH | Pops the last element of source and pushes it onto the front of destination, waiting for an element if source is empty. |
LINDEX | Returns the element at index in the list at key. |
LINSERT | Inserts element before or after the first element equal to pivot, in the list at key. |
LLEN | Returns the number of elements in the list at key. |
LMOVE | Removes an element from one end of source and adds it to one end of destination, in one step. |
LMOVEM | Moves several elements from one end of source to one end of destination in one step, a command of Redis 8.10. |
LMPOP | Pops elements from the first of the given lists that is not empty. |
LPOP | Removes and returns the first element of the list at key. |
LPOS | Returns the index of an element equal to element in the list at key. |
LPUSH | Adds values to the head (left) of the list at key, one after another, so the last value given ends up first. |
LPUSHX | Adds values to the head of the list at key, only if the list exists. |
LRANGE | Returns the elements of the list at key from index start to index stop, both included. |
LREM | Removes elements equal to element from the list at key: - count greater than 0: the first count of them, from the head; - count less than 0: the last -count of them, from the tail; - count 0: all of… |
LSET | Replaces the element at index in the list at key. |
LTRIM | Keeps only the elements from index start to index stop, both included, and removes the rest. |
RPOP | Removes and returns the last element of the list at key. |
RPOPLPUSH | Removes the last element of source and adds it to the head of destination. |
RPUSH | Adds values to the tail (right) of the list at key, in the order given. |
RPUSHX | Adds values to the tail of the list at key, only if the list exists. |
Observability
| Command | Summary |
|---|---|
HOTKEYS | HOTKEYS finds the keys that cost the server the most over a period: the CPU time spent on the commands that name them, the network bytes those commands read and wrote, or both. Subcommands: GET, HELP, RESET, START, STOP. |
LATENCY | The latency monitor: it records, for each kind of event, the times it took longer than latency-monitor-threshold milliseconds, which is 0, off, by default. Subcommands: DOCTOR, GRAPH, HELP, HISTOGRAM, HISTORY, LATEST, RESET. |
SLOWLOG | The slow log: the commands that took longer than slowlog-log-slower-than microseconds to run, up to slowlog-max-len entries (128 by default). Subcommands: GET, HELP, LEN, RESET. |
Other
| Command | Summary |
|---|---|
BACKUP | Takes a consistent backup of the dataset while the server keeps serving: a snapshot as of the start, then the writes that follow, up to the moment it is sealed. Subcommands: ABORT, CLEANUP, HELP, LIST, SEAL, START, STATUS. |
FAILOVER | Refused. |
MODULE | KiviDB does not load modules. Subcommands: HELP, LIST, LOAD, LOADEX, UNLOAD. |
XIDMPRECORD | Records that producer producer-id's idempotent ID idempotent-id produced the entry id, already in the stream at key, as an XADD ... IDMP would have (Redis 8.10). |
Pub/Sub
| Command | Summary |
|---|---|
PING | Checks that the server answers. |
PSUBSCRIBE | Subscribes this connection to every channel matching a glob-style pattern. |
PUBLISH | Sends message to every client subscribed to channel, with SUBSCRIBE, or to a pattern that matches it, with PSUBSCRIBE. |
PUBSUB | PUBSUB is a container: its subcommands report on the channels and patterns clients are subscribed to. Subcommands: CHANNELS, HELP, NUMPAT, NUMSUB, SHARDCHANNELS, SHARDNUMSUB. |
PUNSUBSCRIBE | Unsubscribes this connection from patterns, or from all of them if none is given. |
QUIT | Asks the server to close the connection. |
RESET | Puts the connection back as it was when it was opened: unsubscribed from everything, out of any transaction and with no keys watched, on database 0, speaking RESP2, with no name and no client-side ca… |
SPUBLISH | Sends message to the clients subscribed to the shard channel shardchannel with SSUBSCRIBE. |
SSUBSCRIBE | Subscribes this connection to shard channels. |
SUBSCRIBE | Subscribes this connection to channels. |
SUNSUBSCRIBE | Unsubscribes this connection from shard channels, or from all of them if none is given. |
UNSUBSCRIBE | Unsubscribes this connection from channels, or from all of them if none is given. |
Scripting
| Command | Summary |
|---|---|
EVAL | Runs a Lua script on the server, as one step: no other client's command starts while it runs. |
EVAL_RO | EVAL for a script that only reads: a command in it that writes fails. |
EVALSHA | Runs a script the server already has, named by its SHA1 digest, as SCRIPT LOAD returns it, or as a previous EVAL cached it. |
EVALSHA_RO | Runs a script the server already has, named by its SHA1 digest, as EVALSHA does, on the condition that the script only reads: a command in it that writes fails, and the script stops with that error. |
FCALL | Calls a function of a library loaded with FUNCTION LOAD. |
FCALL_RO | FCALL for a function registered with the no-writes flag; any other is refused. |
FUNCTION | Manages libraries of functions, which FCALL calls. Subcommands: DELETE, DUMP, FLUSH, HELP, KILL, LIST, LOAD, RESTORE, STATS. |
SCRIPT | SCRIPT is a container: its subcommands manage the cache of Lua scripts that EVAL and SCRIPT LOAD fill and EVALSHA runs from, and the script running now. Subcommands: DEBUG, EXISTS, FLUSH, HELP, KILL, LOAD. |
Search
| Command | Summary |
|---|---|
FT._LIST | Returns the names of the indexes of the selected database. |
FT.AGGREGATE | Runs a query and transforms its results: groups them, reduces each group, computes new fields, filters and sorts. |
FT.ALIASADD | Creates an alias for an index: a second name, usable wherever the index's name is. |
FT.ALIASDEL | Deletes an alias made with FT.ALIASADD or FT.ALIASUPDATE. |
FT.ALIASLIST | Returns the aliases that point at an index, the command Redis 8.10 added. |
FT.ALIASUPDATE | Points alias at index. |
FT.ALTER | Adds fields to an index. |
FT.CONFIG | FT.CONFIG is a container: its subcommands read and set the search engine's settings, by the names RediSearch gives them, so that tools and clients that manage those settings work unchanged. Subcommands: GET, HELP, SET. |
FT.CREATE | Creates a search index over the hashes, or JSON documents, whose keys start with the given prefixes. |
FT.CURSOR | FT.CURSOR is a container: its subcommands read and close the cursors that FT.AGGREGATE ... WITHCURSOR opens, so that a large aggregation can be read a page at a time instead of in one reply. Subcommands: DEL, READ. |
FT.DEBUG | Maintenance of search indexes. Subcommands: COMPACT. |
FT.DICTADD | Adds words to a dictionary: a named list of words that FT.SPELLCHECK can use with TERMS INCLUDE or TERMS EXCLUDE. |
FT.DICTDEL | Removes words from a dictionary made with FT.DICTADD. |
FT.DICTDUMP | Returns every word of a dictionary made with FT.DICTADD, sorted, in lower case as they are stored. |
FT.DROPINDEX | Deletes an index. |
FT.EXPLAIN | Returns how a query is understood, as Redis writes a query plan: INTERSECT { ... }, UNION { ... }, NOT{ ... }, OPTIONAL{ ... }, TAG:@field { ... }, NUMERIC {lo <= @field <= hi}, VECTOR { ... }, a cla… |
FT.EXPLAINCLI | FT.EXPLAIN, as an array of its lines. |
FT.HYBRID | Searches an index by text and by vector together, and fuses the two rankings into one. |
FT.INFO | Returns an index's definition and state: its key type and prefixes, its fields with their options, how many documents and terms it holds, and whether it is still indexing. |
FT.PROFILE | Runs a query, SEARCH, AGGREGATE or HYBRID, and returns its result with a profile: total, parsing and lock-wait times, warnings, and the tree of iterators and result processors the query used. |
FT.SEARCH | Searches an index and returns the matching documents. |
FT.SPELLCHECK | Suggests spellings for the words of a query that are not in the index. |
FT.SYNDUMP | Returns the synonym groups of an index, made with FT.SYNUPDATE, turned around: each word, followed by the groups it is in. |
FT.SYNUPDATE | Creates or updates a synonym group of an index: words to be treated as the same. |
FT.TAGVALS | Returns the distinct values of a TAG field across the documents an index holds, sorted. |
Server
| Command | Summary |
|---|---|
BGREWRITEAOF | Rewrites the append-only file in the background, as the shortest file that rebuilds the dataset. |
BGSAVE | Writes a snapshot of the dataset to dump.kdb in the background, and replies at once. |
CLIENT | CLIENT is a container: the work is done by its subcommands, which look at and manage the connections to the server, the one sending them included. Subcommands: CACHING, GETNAME, GETREDIR, HELP, ID, INFO, KILL, LIST, NO-EVICT, NO-TOUCH, PAUSE, REPLY, SETINFO, SETNAME, TRACKING, TRACKINGINFO, UNBLOCK, UNPAUSE. |
COMMAND | Returns every command, each as an array: its name, its arity (a negative number is a minimum), its flags, the positions of its first and last key and the step between them, and its ACL categories. Subcommands: COUNT, DOCS, GETKEYS, GETKEYSANDFLAGS, HELP, INFO, LIST. |
CONFIG | Reads and changes the server's settings at runtime. Subcommands: GET, HELP, RESETSTAT, REWRITE, SET. |
DBSIZE | Returns the number of keys in the current database, the one chosen with SELECT (database 0 unless changed). |
DEBUG | For tests and tools written for Redis. Subcommands: DIGEST-VALUE, HELP, LOG, OBJECT, PAUSE-CRON, POPULATE, PROTOCOL, SET-ACTIVE-EXPIRE, SET-DISABLE-DENY-SCRIPTS, SLEEP. |
ECHO | Returns message, unchanged. |
FLUSHALL | Deletes every key of every database, then replies. |
FLUSHDB | Deletes every key of the current database, the one chosen with SELECT, and leaves the other databases as they are. |
HELLO | Switches the connection to RESP2 or RESP3, and returns the server's details: its name, version, protocol, connection ID, mode, role and modules, as a map under RESP3. |
INFO | Returns information and statistics about the server, as field:value lines in sections. |
LASTSAVE | Returns the Unix time of the last snapshot saved, 0 if none. |
LOLWUT | Returns the KiviDB logo, drawn in block characters, and a last line with the server's version, KiviDB version 1.2.1, bits 64. |
MEMORY | MEMORY is a container: its subcommands report on the server's memory and on what a key takes. Subcommands: DOCTOR, HELP, MALLOC-STATS, PURGE, STATS, USAGE. |
MONITOR | Streams every command the server runs, from any client, to this connection, each as a line: the time, the database and client address, and the command and its arguments. |
PSYNC | Sent by a replica to its master to start or resume replication: PSYNC replication-id offset. |
REPLCONF | Sent by a replica to its master during replication, and not meant for applications. |
REPLICAOF | Makes the server a replica of the master at host port, or, with NO ONE, a master. |
ROLE | Returns the server's replication role, with what a client needs to know about it, in fewer bytes than INFO replication. |
SAVE | Writes a snapshot of the dataset to dump.kdb, in the working directory, before replying. |
SELECT | Makes database index the connection's current one. |
SHUTDOWN | Stops the server, by default after saving a snapshot. |
SLAVEOF | Another name for REPLICAOF, with the same arguments and replies, kept for clients and scripts written before Redis renamed it. |
SYNC | The original replication handshake: a replica sends it to get a snapshot of the master's data, then every write that follows, with no way to resume after a broken link. |
TIME | Returns the server's clock: Unix time in seconds, and the microseconds within that second, as two bulk strings. |
WAIT | Waits until numreplicas replicas have acknowledged every write this connection made before it, or timeout milliseconds pass; 0 waits for ever. |
WAITAOF | Waits for pending writes to be fsynced to the local append-only file, or until timeout milliseconds pass. |
Sets
| Command | Summary |
|---|---|
SADD | Adds members to the set at key. |
SCARD | Returns the number of members of the set at key: its cardinality. |
SDIFF | Returns the members of the first set that are in none of the others. |
SDIFFCARD | Returns how many members the difference of the given sets has, without returning them: a command of Redis 8.10. |
SDIFFSTORE | Stores the difference of the given sets, as SDIFF computes it, at destination, replacing whatever was there, and its expiry. |
SINTER | Returns the members that are in every one of the given sets. |
SINTERCARD | Returns how many members the intersection of the given sets has, without returning them. |
SINTERSTORE | Stores the intersection of the given sets, as SINTER computes it, at destination, replacing whatever was there, and its expiry. |
SISMEMBER | Tells whether member is in the set at key. |
SMEMBERS | Returns every member of the set at key, in no particular order. |
SMISMEMBER | Tells, for each of several members, whether it is in the set at key. |
SMOVE | Moves member from the set at source to the set at destination, in one step. |
SPOP | Removes and returns members of the set at key, picked at random. |
SRANDMEMBER | Returns members of the set at key, picked at random, without removing them. |
SREM | Removes members from the set at key. |
SSCAN | Goes through the members of the set at key a page at a time, as SCAN goes through keys. |
SUNION | Returns the members that are in any of the given sets. |
SUNIONCARD | Returns how many members the union of the given sets has, without returning them: a command of Redis 8.10. |
SUNIONSTORE | Stores the union of the given sets at destination, replacing whatever was there, and its expiry. |
Sorted sets
| Command | Summary |
|---|---|
BZMPOP | ZMPOP that waits until one of the sorted sets has a member, or timeout seconds have passed. |
BZPOPMAX | Removes and returns the member with the highest score from the first non-empty sorted set among the keys given. |
BZPOPMIN | ZPOPMIN of one member from the first non-empty sorted set of those given. |
ZADD | Adds members with scores to the sorted set at key, or updates the scores of members already in it. |
ZCARD | Returns the number of members of the sorted set at key: the size of a leaderboard, or of a queue kept as a sorted set. |
ZCOUNT | Counts the members of the sorted set at key with a score between min and max. |
ZDIFF | Returns the members of the first sorted set that are in none of the others, with their scores if WITHSCORES is given. |
ZDIFFSTORE | Stores what ZDIFF would return at destination, replacing whatever was there. |
ZINCRBY | Adds increment to the score of member in the sorted set at key. |
ZINTER | Returns the members in every one of the given sorted sets, with scores combined. |
ZINTERCARD | Returns how many members the intersection of the given sorted sets has, without returning them. |
ZINTERSTORE | Stores what ZINTER would return at destination, replacing whatever was there. |
ZLEXCOUNT | Counts the members of the sorted set at key between min and max in lexicographical order. |
ZMPOP | Pops members from the first of the given sorted sets that is not empty: the lowest (MIN) or highest (MAX) scores, one or COUNT count of them. |
ZMSCORE | Returns the scores of several members of the sorted set at key. |
ZPOPMAX | Removes and returns the members with the highest scores in the sorted set at key: one, or count. |
ZPOPMIN | Removes and returns the members with the lowest scores in the sorted set at key: one, or count. |
ZRANDMEMBER | Returns members of the sorted set at key, picked at random, without removing them. |
ZRANGE | Returns members of the sorted set at key in a range. |
ZRANGEBYLEX | Returns members of the sorted set at key between min and max in lexicographical order, for sets whose members all have the same score. |
ZRANGEBYSCORE | Returns members of the sorted set at key with scores from min to max, lowest first. |
ZRANGESTORE | Stores the members ZRANGE would return, with their scores, at dst, replacing whatever was there. |
ZRANK | Returns the rank of member in the sorted set at key: its position from the lowest score, starting at 0. |
ZREM | Removes one or more members from the sorted set at key. |
ZREMRANGEBYLEX | Removes the members of the sorted set at key between min and max in lexicographical order, with bounds as ZRANGEBYLEX takes them. |
ZREMRANGEBYRANK | Removes the members of the sorted set at key with ranks from start to stop, both included. |
ZREMRANGEBYSCORE | Removes the members of the sorted set at key with scores from min to max. |
ZREVRANGE | Returns members of the sorted set at key by rank, highest score first. |
ZREVRANGEBYLEX | Returns members of the sorted set at key between max and min, in reverse lexicographical order. |
ZREVRANGEBYSCORE | Returns members of the sorted set at key with scores from max down to min. |
ZREVRANK | Returns the rank of member from the highest score, starting at 0. |
ZSCAN | Goes through the members of the sorted set at key a page at a time, as SCAN goes through keys. |
ZSCORE | Returns the score of member in the sorted set at key. |
ZUNION | Returns the members in any of the given sorted sets, with scores combined. |
ZUNIONSTORE | Stores what ZUNION would return at destination, replacing whatever was there. |
Streams
| Command | Summary |
|---|---|
XACK | Acknowledges entries that the consumer group group delivered: they leave the group's pending entries list, and XPENDING no longer shows them. |
XACKDEL | Acknowledges entries for the group and deletes them from the stream, in one step (Redis 8.2). |
XADD | Appends an entry, a set of field-value pairs, to the stream at key. |
XAUTOCLAIM | Goes through the group's pending entries from start and gives consumer those idle at least min-idle-time milliseconds, COUNT count at a time (100 by default). |
XCFGSET | Sets the configuration of the stream at key. |
XCLAIM | Gives pending entries to consumer, if they have been idle at least min-idle-time milliseconds: for when the consumer that had them stopped. |
XDEL | Deletes entries from the stream at key by ID. |
XDELEX | Deletes entries from the stream at key, with control over the references consumer groups hold to them (Redis 8.2). |
XGROUP | XGROUP is a container: its subcommands create and manage consumer groups. Subcommands: CREATE, CREATECONSUMER, DELCONSUMER, DESTROY, HELP, SETID. |
XINFO | XINFO is a container: its subcommands report on a stream, its consumer groups, and their consumers. Subcommands: CONSUMERS, GROUPS, HELP, STREAM. |
XLEN | Returns the number of entries in the stream at key. |
XNACK | Releases pending entries back to the group without acknowledging them, so that another consumer can take them at once, with XREADGROUP ... CLAIM or XAUTOCLAIM. |
XPENDING | Returns the entries the group has delivered and that are not yet acknowledged. |
XRANGE | Returns the entries of the stream at key with IDs from start to end, both included, oldest first. |
XREAD | Reads entries with IDs greater than the ones given, from one or more streams. |
XREADGROUP | Reads entries for consumer of consumer group group. |
XREVRANGE | Returns the entries of the stream at key from end down to start, newest first: XRANGE in reverse, with the two bounds given the other way round. |
XSETID | Sets the last ID of the stream at key, so that new entries get greater IDs. |
XTRIM | Removes the oldest entries of the stream at key. |
Strings
| Command | Summary |
|---|---|
APPEND | Appends value to the string at key. |
DECR | Subtracts 1 from the integer stored at key. |
DECRBY | Subtracts decrement, a signed 64-bit integer, from the integer stored at key. |
DELEX | Deletes key, optionally only if its string value, or the value's digest, matches. |
DIGEST | Returns a digest of the string at key: the XXH3 64-bit hash of the value, as 16 hexadecimal digits. |
GET | Returns the string stored at key. |
GETDEL | Returns the string at key and deletes the key, in one step. |
GETEX | Returns the string at key and, optionally, changes its expiry. |
GETRANGE | Returns the bytes of the string at key from offset start to offset end, both included. |
GETSET | Sets key to value and returns the value it held before, in one step. |
INCR | Adds 1 to the integer stored at key. |
INCRBY | Adds increment, a signed 64-bit integer, to the integer stored at key. |
INCRBYFLOAT | Adds increment, a floating-point number, to the number stored at key. |
INCREX | Increments the number at key with bounds, and optionally sets its expiry, in one step. |
LCS | Finds the longest common subsequence of the strings at key1 and key2: the longest run of characters found in both, in the same order, not necessarily next to each other. |
MGET | Returns the values of several keys. |
MSET | Sets several keys to string values in one step. |
MSETEX | Sets several keys in one step, with one expiry for all of them, and optionally only if they all exist or none does. |
MSETNX | Sets several keys to string values only if none of them exists. |
PSETEX | Sets key to value and makes it expire after milliseconds. |
SET | Stores a string at key, replacing whatever the key held, of any type. |
SETEX | Sets key to value and makes it expire after seconds. |
SETNX | Sets key to value only if the key does not exist. |
SETRANGE | Overwrites the string at key from byte offset on with value. |
STRLEN | Returns the length, in bytes, of the string at key. |
SUBSTR | Returns part of the string at key, from byte offset start to byte offset stop, both included. |
Time series
| Command | Summary |
|---|---|
TS.ADD | Adds a sample to the time series at key: timestamp in milliseconds, or * for the server's clock, and value, a floating-point number or NaN. |
TS.ALTER | Changes the settings of an existing time series: its retention, chunk size, duplicate policy or labels. |
TS.CREATE | Creates a time series at key: samples, each a timestamp in milliseconds and a floating-point value, kept in timestamp order. |
TS.CREATERULE | Creates a compaction rule: every sample added to sourceKey is aggregated, by agg over buckets of bucketDuration milliseconds, into the existing series destKey. |
TS.DECRBY | Adds a sample whose value is the series' last value minus value, for counters that go down: stock left, open slots, a balance. |
TS.DEL | Deletes the samples of the time series at key from fromTimestamp to toTimestamp, both included, and returns how many there were. |
TS.DELETERULE | Deletes the compaction rule from sourceKey to destKey that TS.CREATERULE made. |
TS.GET | Returns the newest sample of the time series at key. |
TS.INCRBY | Adds a sample whose value is the series' last value plus value; a missing series starts at 0. |
TS.INFO | Returns a time series' metadata: its number of samples, memory use, first and last timestamps, retention, chunk size, duplicate policy, labels, the series it is compacted from (sourceKey, nil if none… |
TS.MADD | Adds samples to one or more time series in one call, creating series that do not exist. |
TS.MGET | Returns the newest sample of every time series whose labels match the FILTER (see TS.MRANGE for conditions). |
TS.MRANGE | Runs TS.RANGE over every time series whose labels match the FILTER, and returns each with its samples. |
TS.MREVRANGE | Runs TS.REVRANGE over every time series whose labels match the FILTER, and returns each with its samples, newest first. |
TS.NRANGE | Runs the same range over several named time series and joins the results by timestamp, a command of Redis 8.10. |
TS.NREVRANGE | Runs the same range over several named time series and joins the results by timestamp, newest first. |
TS.QUERYINDEX | Returns the keys of every time series whose labels match all the given conditions, sorted by key. |
TS.QUERYLABELS | Returns the label names in use, with LABELS, or the values of one label, with VALUES label, across the time series that match the FILTER conditions, or all of them (Redis 8.10). |
TS.RANGE | Returns the samples of the time series at key from fromTimestamp to toTimestamp, both included, oldest first. |
TS.READ | Returns the samples of the time series at key at or after timestamp, oldest first, for following a series as it grows (Redis 8.10). |
TS.REVRANGE | Returns the samples of the time series at key from fromTimestamp to toTimestamp, both included, newest first. |
Transactions
| Command | Summary |
|---|---|
DISCARD | Ends a transaction without running it: the commands queued since MULTI are dropped, none of them runs, and the connection is back to running each command as it is sent. |
EXEC | Runs the commands queued since MULTI, as one step: no other client's command that could see their keys starts between two of them, reads included, so nobody sees the transaction half done. |
MULTI | Starts a transaction on this connection. |
UNWATCH | Stops watching every key the connection watches with WATCH, so that the next EXEC no longer depends on them. |
WATCH | Watches keys for the next transaction on this connection: if any of them is changed, by any client, before EXEC, the transaction runs nothing and EXEC replies nil. |
Vector sets
| Command | Summary |
|---|---|
VADD | Adds an element with its vector to the vector set at key, or replaces an element's vector. |
VCARD | Returns the number of elements in the vector set at key. |
VDIM | Returns the number of dimensions of the vectors in the vector set at key. |
VEMB | Returns the vector of element in the vector set at key, as one number per dimension. |
VGETATTR | Returns the attributes of element in the vector set at key: the string set with VADD ... SETATTR or VSETATTR, as it was given. |
VINFO | Returns the vector set's dimensions, its number of elements, its quantization, its index type and its graph's levels. |
VISMEMBER | Tells whether element is in the vector set at key: 1 if it is, 0 if not. |
VLINKS | Returns an element's nearest neighbours, up to 16, as one level; WITHSCORES gives their similarity, scored as VSIM scores it. |
VRANDMEMBER | Returns elements of the vector set at key, picked at random. |
VRANGE | Returns the elements of the vector set at key between two names in lexicographical order, with bounds as ZRANGEBYLEX takes them, and at most count. |
VREM | Removes elements, with their vectors and attributes, from the vector set at key, and returns how many it removed. |
VSETATTR | Sets the attributes of an element of the vector set at key, replacing any it had. |
VSIM | Returns the elements of the vector set at key most similar to a vector, most similar first. |