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

CommandSummary
ACLManages 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.
AUTHLogs the connection in as a user: AUTH username password, or, with a password only, as the default user.

Arrays

CommandSummary
ARCOUNTReturns the number of filled slots in the array at key.
ARDELEmpties the slots at the given indexes in the array at key.
ARDELRANGEEmpties every slot from start to end, both included, in the array at key, for one or more ranges.
ARGETReturns the value at index in the array at key.
ARGETRANGEReturns every slot from start to end, both included, nil for empty ones.
ARGREPReturns the indexes of the slots from start to end whose values match.
ARINFOReturns 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.
ARINSERTWrites values at the array's insert cursor, moving the cursor on one slot per value.
ARLASTITEMSReturns the count slots before the insert cursor, oldest first, or newest first with REV, nil for empty ones.
ARLENReturns the highest filled index plus one; 0 for a missing key.
ARMGETReturns the values at several indexes in the array at key, in one call.
ARMSETSets values at several indexes in the array at key, in one call.
ARNEXTReturns the index the next ARINSERT on the array at key will write to.
AROPComputes over the filled slots from start to end.
ARRINGWrites values into a ring buffer of size slots: the cursor wraps around at size, so newer values overwrite the oldest.
ARSCANReturns the filled slots from start to end, skipping empty ones, as [index, value] pairs; in reverse with start greater than end.
ARSEEKMoves the insert cursor of the array at key to index, so the next ARINSERT writes there.
ARSETSets values in the array at key from index on, one slot each.

Bitmaps

CommandSummary
BITCOUNTCounts the bits set to 1 in the string at key, or in a part of it.
BITFIELDReads, 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_ROBITFIELD with GET only: it only reads, so it can be sent to a read-only replica.
BITOPCombines the strings at the source keys bit by bit and stores the result at destkey.
BITPOSReturns the position of the first bit set to bit (0 or 1) in the string at key, or in a part of it.
GETBITReturns the bit at offset in the string at key.
SETBITSets or clears the bit at offset in the string at key.

Cluster

CommandSummary
ASKINGLets the connection's next command use a slot this node is importing (CLUSTER SETSLOT ... IMPORTING) but does not own yet.
CLUSTERManages 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.
MIGRATEMoves 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.
READONLYLets the connection read from this replica: read commands for the slots of its master are served here, instead of being answered with MOVED.
READWRITETurns off READONLY for the connection.

Geospatial

CommandSummary
GEOADDAdds 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.
GEODISTReturns the distance between two members of the geospatial index at key, in metres, or in KM, FT or MI.
GEOHASHReturns the geohash of members of the geospatial index at key: the standard 11-character base32 string, which other geohash tools read.
GEOPOSReturns the longitude and latitude of members of the geospatial index at key.
GEORADIUSReturns the members of the geospatial index at key within radius of a longitude and latitude.
GEORADIUS_ROReturns 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.
GEORADIUSBYMEMBERGEORADIUS centred on a member of the index, not a position.
GEORADIUSBYMEMBER_ROReturns 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…
GEOSEARCHReturns the members of the geospatial index at key within a circle or a box.
GEOSEARCHSTOREStores the members GEOSEARCH would return at destination.

Hashes

CommandSummary
HDELDeletes fields from the hash at key.
HEXISTSTells whether field exists in the hash at key.
HEXPIREMakes fields of the hash at key expire after seconds.
HEXPIREATMakes fields of the hash at key expire at a Unix time, in seconds.
HEXPIRETIMEReturns 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.
HGETReturns the value of field in the hash at key.
HGETALLReturns every field of the hash at key with its value.
HGETDELReturns the values of fields of the hash at key and deletes those fields, in one step.
HGETEXReturns the values of fields of the hash at key and, optionally, changes their expiry, in one step.
HIMPORTLoads many hashes that have the same fields, without sending the field names for each: a command of Redis 8.10. Subcommands: DISCARD, PREPARE, SET.
HINCRBYAdds increment, a 64-bit integer, to the integer value of field in the hash at key.
HINCRBYFLOATAdds increment, a floating-point number, to the value of field in the hash at key.
HKEYSReturns the names of all the fields of the hash at key.
HLENReturns the number of fields in the hash at key.
HMGETReturns the values of several fields of the hash at key.
HMSETSets fields of the hash at key, each to its value, as HSET does, and replies OK instead of a count.
HPERSISTRemoves the expiry of fields of the hash at key.
HPEXPIREMakes fields of the hash at key expire after milliseconds.
HPEXPIREATMakes fields of the hash at key expire at a Unix time given in milliseconds.
HPEXPIRETIMEReturns the Unix time, in milliseconds, at which fields of the hash at key expire.
HPTTLReturns how long fields of the hash at key have before they expire, in milliseconds.
HRANDFIELDReturns fields of the hash at key, picked at random.
HSCANGoes through the fields of the hash at key a page at a time, as SCAN goes through keys.
HSETSets fields of the hash at key, each to its value.
HSETEXSets fields of the hash at key, with one expiry for all of them, in one step.
HSETNXSets field in the hash at key only if the field does not exist.
HSTRLENReturns the length, in bytes, of the value of field in the hash at key.
HTTLReturns 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.
HVALSReturns the values of all the fields of the hash at key, without their names.

HyperLogLog

CommandSummary
PFADDAdds 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.
PFCOUNTReturns the estimated number of different elements added to the HyperLogLog at key.
PFDEBUGInspects or converts a HyperLogLog. Subcommands: DECODE, ENCODING, GETREG, RESET, TODENSE.
PFMERGEMerges the HyperLogLogs at the source keys into destkey, so that it estimates their union.
PFSELFTESTRuns KiviDB's checks of its HyperLogLog code and says whether they passed.

JSON

CommandSummary
JSON.ARRAPPENDAppends one or more values to the end of each array path matches in the JSON document at key.
JSON.ARRINDEXReturns the index of the first element equal to value, JSON text, in each array path matches, from start to stop.
JSON.ARRINSERTInserts one or more values into each array path matches, before the element at index.
JSON.ARRLENReturns the number of elements in each array path matches in the JSON document at key.
JSON.ARRPOPRemoves and returns an element from each array path matches: the last one, or the one at index.
JSON.ARRTRIMKeeps only the elements from start to stop, both included, in each array path matches.
JSON.CLEARResets values in a JSON document without removing them: each array and object path matches is emptied, and each number becomes 0.
JSON.DEBUGA container for commands that report on JSON documents rather than read or change them. Subcommands: HELP, MEMORY.
JSON.DELDeletes the values path matches in the JSON document at key.
JSON.FORGETAnother name for JSON.DEL: it takes the same arguments and gives the same reply.
JSON.GETReturns values from the JSON document at key, as JSON text.
JSON.MERGEMerges 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.MGETEvaluates path in the JSON documents at several keys.
JSON.MSETRuns JSON.SET for several key, path and value triples in one command.
JSON.NUMINCRBYAdds number to each number path matches.
JSON.NUMMULTBYMultiplies each number path matches in the JSON document at key by number, and stores the result in place.
JSON.OBJKEYSReturns the member names of each object path matches in the JSON document at key.
JSON.OBJLENReturns the number of members in each object path matches in the JSON document at key.
JSON.RESPReturns 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.SETSets the value at path in the JSON document at key to value, which is JSON text.
JSON.STRAPPENDAppends a JSON string to each string path matches.
JSON.STRLENReturns the length of each string path matches in the JSON document at key.
JSON.TOGGLEFlips each boolean path matches in the JSON document at key: true becomes false and false becomes true.
JSON.TYPEReturns the type of each value path matches: object, array, string, integer, number, boolean or null.

Keys

CommandSummary
COPYCopies the value at source to destination, with its expiry.
DELDeletes the given keys, whatever their type, and returns how many it deleted.
DUMPSerializes the value at key into a payload that RESTORE turns back into the value.
EXISTSReturns how many of the given keys exist.
EXPIREMakes key expire after seconds.
EXPIREATMakes key expire at a Unix time, in seconds.
EXPIRETIMEReturns 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.
KEYSReturns every key of the current database that matches a glob-style pattern.
MOVEMoves key to database db.
OBJECTOBJECT 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.
PERSISTRemoves the expiry of key, so that it is kept until deleted.
PEXPIREMakes key expire after milliseconds.
PEXPIREATMakes key expire at a Unix time, in milliseconds.
PEXPIRETIMEReturns the Unix time, in milliseconds, at which key expires.
PTTLReturns how long key has left before it expires, in milliseconds.
RANDOMKEYReturns the name of a key of the current database, picked at random, or nil if the database has no keys.
RENAMERenames source to destination, with its expiry.
RENAMENXRenames source to destination only if destination does not exist.
RESTORECreates key from a DUMP payload.
SCANGoes through the keys of the current database a page at a time.
SORTSorts the elements of a list, set or sorted set, as numbers unless ALPHA is given.
SORT_ROSORT without STORE: it only reads, so it can be sent to a read-only replica.
SWAPDBSwaps 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.
TOUCHMarks the given keys as used, and returns how many of them exist.
TTLReturns 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.
TYPEReturns the type of the value at key.
UNLINKDeletes the given keys, like DEL, but frees large values in the background.

Lists

CommandSummary
BLMOVEMoves an element from one list to another in one step, waiting for one if source is empty.
BLMOVEMLMOVEM that waits until source has an element, or, with EXACTLY, enough of them, or until timeout seconds have passed.
BLMPOPLMPOP that waits until one of the lists has an element, or timeout seconds have passed.
BLPOPPops the first element of the first non-empty list of those given.
BRPOPPops the last element of the first non-empty list among the keys given.
BRPOPLPUSHPops the last element of source and pushes it onto the front of destination, waiting for an element if source is empty.
LINDEXReturns the element at index in the list at key.
LINSERTInserts element before or after the first element equal to pivot, in the list at key.
LLENReturns the number of elements in the list at key.
LMOVERemoves an element from one end of source and adds it to one end of destination, in one step.
LMOVEMMoves several elements from one end of source to one end of destination in one step, a command of Redis 8.10.
LMPOPPops elements from the first of the given lists that is not empty.
LPOPRemoves and returns the first element of the list at key.
LPOSReturns the index of an element equal to element in the list at key.
LPUSHAdds values to the head (left) of the list at key, one after another, so the last value given ends up first.
LPUSHXAdds values to the head of the list at key, only if the list exists.
LRANGEReturns the elements of the list at key from index start to index stop, both included.
LREMRemoves 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…
LSETReplaces the element at index in the list at key.
LTRIMKeeps only the elements from index start to index stop, both included, and removes the rest.
RPOPRemoves and returns the last element of the list at key.
RPOPLPUSHRemoves the last element of source and adds it to the head of destination.
RPUSHAdds values to the tail (right) of the list at key, in the order given.
RPUSHXAdds values to the tail of the list at key, only if the list exists.

Observability

CommandSummary
HOTKEYSHOTKEYS 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.
LATENCYThe 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.
SLOWLOGThe 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

CommandSummary
BACKUPTakes 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.
FAILOVERRefused.
MODULEKiviDB does not load modules. Subcommands: HELP, LIST, LOAD, LOADEX, UNLOAD.
XIDMPRECORDRecords 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

CommandSummary
PINGChecks that the server answers.
PSUBSCRIBESubscribes this connection to every channel matching a glob-style pattern.
PUBLISHSends message to every client subscribed to channel, with SUBSCRIBE, or to a pattern that matches it, with PSUBSCRIBE.
PUBSUBPUBSUB is a container: its subcommands report on the channels and patterns clients are subscribed to. Subcommands: CHANNELS, HELP, NUMPAT, NUMSUB, SHARDCHANNELS, SHARDNUMSUB.
PUNSUBSCRIBEUnsubscribes this connection from patterns, or from all of them if none is given.
QUITAsks the server to close the connection.
RESETPuts 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…
SPUBLISHSends message to the clients subscribed to the shard channel shardchannel with SSUBSCRIBE.
SSUBSCRIBESubscribes this connection to shard channels.
SUBSCRIBESubscribes this connection to channels.
SUNSUBSCRIBEUnsubscribes this connection from shard channels, or from all of them if none is given.
UNSUBSCRIBEUnsubscribes this connection from channels, or from all of them if none is given.

Scripting

CommandSummary
EVALRuns a Lua script on the server, as one step: no other client's command starts while it runs.
EVAL_ROEVAL for a script that only reads: a command in it that writes fails.
EVALSHARuns a script the server already has, named by its SHA1 digest, as SCRIPT LOAD returns it, or as a previous EVAL cached it.
EVALSHA_RORuns 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.
FCALLCalls a function of a library loaded with FUNCTION LOAD.
FCALL_ROFCALL for a function registered with the no-writes flag; any other is refused.
FUNCTIONManages libraries of functions, which FCALL calls. Subcommands: DELETE, DUMP, FLUSH, HELP, KILL, LIST, LOAD, RESTORE, STATS.
SCRIPTSCRIPT 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

CommandSummary
FT._LISTReturns the names of the indexes of the selected database.
FT.AGGREGATERuns a query and transforms its results: groups them, reduces each group, computes new fields, filters and sorts.
FT.ALIASADDCreates an alias for an index: a second name, usable wherever the index's name is.
FT.ALIASDELDeletes an alias made with FT.ALIASADD or FT.ALIASUPDATE.
FT.ALIASLISTReturns the aliases that point at an index, the command Redis 8.10 added.
FT.ALIASUPDATEPoints alias at index.
FT.ALTERAdds fields to an index.
FT.CONFIGFT.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.CREATECreates a search index over the hashes, or JSON documents, whose keys start with the given prefixes.
FT.CURSORFT.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.DEBUGMaintenance of search indexes. Subcommands: COMPACT.
FT.DICTADDAdds words to a dictionary: a named list of words that FT.SPELLCHECK can use with TERMS INCLUDE or TERMS EXCLUDE.
FT.DICTDELRemoves words from a dictionary made with FT.DICTADD.
FT.DICTDUMPReturns every word of a dictionary made with FT.DICTADD, sorted, in lower case as they are stored.
FT.DROPINDEXDeletes an index.
FT.EXPLAINReturns 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.EXPLAINCLIFT.EXPLAIN, as an array of its lines.
FT.HYBRIDSearches an index by text and by vector together, and fuses the two rankings into one.
FT.INFOReturns 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.PROFILERuns 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.SEARCHSearches an index and returns the matching documents.
FT.SPELLCHECKSuggests spellings for the words of a query that are not in the index.
FT.SYNDUMPReturns the synonym groups of an index, made with FT.SYNUPDATE, turned around: each word, followed by the groups it is in.
FT.SYNUPDATECreates or updates a synonym group of an index: words to be treated as the same.
FT.TAGVALSReturns the distinct values of a TAG field across the documents an index holds, sorted.

Server

CommandSummary
BGREWRITEAOFRewrites the append-only file in the background, as the shortest file that rebuilds the dataset.
BGSAVEWrites a snapshot of the dataset to dump.kdb in the background, and replies at once.
CLIENTCLIENT 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.
COMMANDReturns 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.
CONFIGReads and changes the server's settings at runtime. Subcommands: GET, HELP, RESETSTAT, REWRITE, SET.
DBSIZEReturns the number of keys in the current database, the one chosen with SELECT (database 0 unless changed).
DEBUGFor tests and tools written for Redis. Subcommands: DIGEST-VALUE, HELP, LOG, OBJECT, PAUSE-CRON, POPULATE, PROTOCOL, SET-ACTIVE-EXPIRE, SET-DISABLE-DENY-SCRIPTS, SLEEP.
ECHOReturns message, unchanged.
FLUSHALLDeletes every key of every database, then replies.
FLUSHDBDeletes every key of the current database, the one chosen with SELECT, and leaves the other databases as they are.
HELLOSwitches 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.
INFOReturns information and statistics about the server, as field:value lines in sections.
LASTSAVEReturns the Unix time of the last snapshot saved, 0 if none.
LOLWUTReturns the KiviDB logo, drawn in block characters, and a last line with the server's version, KiviDB version 1.2.1, bits 64.
MEMORYMEMORY 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.
MONITORStreams 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.
PSYNCSent by a replica to its master to start or resume replication: PSYNC replication-id offset.
REPLCONFSent by a replica to its master during replication, and not meant for applications.
REPLICAOFMakes the server a replica of the master at host port, or, with NO ONE, a master.
ROLEReturns the server's replication role, with what a client needs to know about it, in fewer bytes than INFO replication.
SAVEWrites a snapshot of the dataset to dump.kdb, in the working directory, before replying.
SELECTMakes database index the connection's current one.
SHUTDOWNStops the server, by default after saving a snapshot.
SLAVEOFAnother name for REPLICAOF, with the same arguments and replies, kept for clients and scripts written before Redis renamed it.
SYNCThe 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.
TIMEReturns the server's clock: Unix time in seconds, and the microseconds within that second, as two bulk strings.
WAITWaits until numreplicas replicas have acknowledged every write this connection made before it, or timeout milliseconds pass; 0 waits for ever.
WAITAOFWaits for pending writes to be fsynced to the local append-only file, or until timeout milliseconds pass.

Sets

CommandSummary
SADDAdds members to the set at key.
SCARDReturns the number of members of the set at key: its cardinality.
SDIFFReturns the members of the first set that are in none of the others.
SDIFFCARDReturns how many members the difference of the given sets has, without returning them: a command of Redis 8.10.
SDIFFSTOREStores the difference of the given sets, as SDIFF computes it, at destination, replacing whatever was there, and its expiry.
SINTERReturns the members that are in every one of the given sets.
SINTERCARDReturns how many members the intersection of the given sets has, without returning them.
SINTERSTOREStores the intersection of the given sets, as SINTER computes it, at destination, replacing whatever was there, and its expiry.
SISMEMBERTells whether member is in the set at key.
SMEMBERSReturns every member of the set at key, in no particular order.
SMISMEMBERTells, for each of several members, whether it is in the set at key.
SMOVEMoves member from the set at source to the set at destination, in one step.
SPOPRemoves and returns members of the set at key, picked at random.
SRANDMEMBERReturns members of the set at key, picked at random, without removing them.
SREMRemoves members from the set at key.
SSCANGoes through the members of the set at key a page at a time, as SCAN goes through keys.
SUNIONReturns the members that are in any of the given sets.
SUNIONCARDReturns how many members the union of the given sets has, without returning them: a command of Redis 8.10.
SUNIONSTOREStores the union of the given sets at destination, replacing whatever was there, and its expiry.

Sorted sets

CommandSummary
BZMPOPZMPOP that waits until one of the sorted sets has a member, or timeout seconds have passed.
BZPOPMAXRemoves and returns the member with the highest score from the first non-empty sorted set among the keys given.
BZPOPMINZPOPMIN of one member from the first non-empty sorted set of those given.
ZADDAdds members with scores to the sorted set at key, or updates the scores of members already in it.
ZCARDReturns the number of members of the sorted set at key: the size of a leaderboard, or of a queue kept as a sorted set.
ZCOUNTCounts the members of the sorted set at key with a score between min and max.
ZDIFFReturns the members of the first sorted set that are in none of the others, with their scores if WITHSCORES is given.
ZDIFFSTOREStores what ZDIFF would return at destination, replacing whatever was there.
ZINCRBYAdds increment to the score of member in the sorted set at key.
ZINTERReturns the members in every one of the given sorted sets, with scores combined.
ZINTERCARDReturns how many members the intersection of the given sorted sets has, without returning them.
ZINTERSTOREStores what ZINTER would return at destination, replacing whatever was there.
ZLEXCOUNTCounts the members of the sorted set at key between min and max in lexicographical order.
ZMPOPPops 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.
ZMSCOREReturns the scores of several members of the sorted set at key.
ZPOPMAXRemoves and returns the members with the highest scores in the sorted set at key: one, or count.
ZPOPMINRemoves and returns the members with the lowest scores in the sorted set at key: one, or count.
ZRANDMEMBERReturns members of the sorted set at key, picked at random, without removing them.
ZRANGEReturns members of the sorted set at key in a range.
ZRANGEBYLEXReturns members of the sorted set at key between min and max in lexicographical order, for sets whose members all have the same score.
ZRANGEBYSCOREReturns members of the sorted set at key with scores from min to max, lowest first.
ZRANGESTOREStores the members ZRANGE would return, with their scores, at dst, replacing whatever was there.
ZRANKReturns the rank of member in the sorted set at key: its position from the lowest score, starting at 0.
ZREMRemoves one or more members from the sorted set at key.
ZREMRANGEBYLEXRemoves the members of the sorted set at key between min and max in lexicographical order, with bounds as ZRANGEBYLEX takes them.
ZREMRANGEBYRANKRemoves the members of the sorted set at key with ranks from start to stop, both included.
ZREMRANGEBYSCORERemoves the members of the sorted set at key with scores from min to max.
ZREVRANGEReturns members of the sorted set at key by rank, highest score first.
ZREVRANGEBYLEXReturns members of the sorted set at key between max and min, in reverse lexicographical order.
ZREVRANGEBYSCOREReturns members of the sorted set at key with scores from max down to min.
ZREVRANKReturns the rank of member from the highest score, starting at 0.
ZSCANGoes through the members of the sorted set at key a page at a time, as SCAN goes through keys.
ZSCOREReturns the score of member in the sorted set at key.
ZUNIONReturns the members in any of the given sorted sets, with scores combined.
ZUNIONSTOREStores what ZUNION would return at destination, replacing whatever was there.

Streams

CommandSummary
XACKAcknowledges entries that the consumer group group delivered: they leave the group's pending entries list, and XPENDING no longer shows them.
XACKDELAcknowledges entries for the group and deletes them from the stream, in one step (Redis 8.2).
XADDAppends an entry, a set of field-value pairs, to the stream at key.
XAUTOCLAIMGoes 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).
XCFGSETSets the configuration of the stream at key.
XCLAIMGives pending entries to consumer, if they have been idle at least min-idle-time milliseconds: for when the consumer that had them stopped.
XDELDeletes entries from the stream at key by ID.
XDELEXDeletes entries from the stream at key, with control over the references consumer groups hold to them (Redis 8.2).
XGROUPXGROUP is a container: its subcommands create and manage consumer groups. Subcommands: CREATE, CREATECONSUMER, DELCONSUMER, DESTROY, HELP, SETID.
XINFOXINFO is a container: its subcommands report on a stream, its consumer groups, and their consumers. Subcommands: CONSUMERS, GROUPS, HELP, STREAM.
XLENReturns the number of entries in the stream at key.
XNACKReleases pending entries back to the group without acknowledging them, so that another consumer can take them at once, with XREADGROUP ... CLAIM or XAUTOCLAIM.
XPENDINGReturns the entries the group has delivered and that are not yet acknowledged.
XRANGEReturns the entries of the stream at key with IDs from start to end, both included, oldest first.
XREADReads entries with IDs greater than the ones given, from one or more streams.
XREADGROUPReads entries for consumer of consumer group group.
XREVRANGEReturns 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.
XSETIDSets the last ID of the stream at key, so that new entries get greater IDs.
XTRIMRemoves the oldest entries of the stream at key.

Strings

CommandSummary
APPENDAppends value to the string at key.
DECRSubtracts 1 from the integer stored at key.
DECRBYSubtracts decrement, a signed 64-bit integer, from the integer stored at key.
DELEXDeletes key, optionally only if its string value, or the value's digest, matches.
DIGESTReturns a digest of the string at key: the XXH3 64-bit hash of the value, as 16 hexadecimal digits.
GETReturns the string stored at key.
GETDELReturns the string at key and deletes the key, in one step.
GETEXReturns the string at key and, optionally, changes its expiry.
GETRANGEReturns the bytes of the string at key from offset start to offset end, both included.
GETSETSets key to value and returns the value it held before, in one step.
INCRAdds 1 to the integer stored at key.
INCRBYAdds increment, a signed 64-bit integer, to the integer stored at key.
INCRBYFLOATAdds increment, a floating-point number, to the number stored at key.
INCREXIncrements the number at key with bounds, and optionally sets its expiry, in one step.
LCSFinds 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.
MGETReturns the values of several keys.
MSETSets several keys to string values in one step.
MSETEXSets several keys in one step, with one expiry for all of them, and optionally only if they all exist or none does.
MSETNXSets several keys to string values only if none of them exists.
PSETEXSets key to value and makes it expire after milliseconds.
SETStores a string at key, replacing whatever the key held, of any type.
SETEXSets key to value and makes it expire after seconds.
SETNXSets key to value only if the key does not exist.
SETRANGEOverwrites the string at key from byte offset on with value.
STRLENReturns the length, in bytes, of the string at key.
SUBSTRReturns part of the string at key, from byte offset start to byte offset stop, both included.

Time series

CommandSummary
TS.ADDAdds 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.ALTERChanges the settings of an existing time series: its retention, chunk size, duplicate policy or labels.
TS.CREATECreates a time series at key: samples, each a timestamp in milliseconds and a floating-point value, kept in timestamp order.
TS.CREATERULECreates a compaction rule: every sample added to sourceKey is aggregated, by agg over buckets of bucketDuration milliseconds, into the existing series destKey.
TS.DECRBYAdds a sample whose value is the series' last value minus value, for counters that go down: stock left, open slots, a balance.
TS.DELDeletes the samples of the time series at key from fromTimestamp to toTimestamp, both included, and returns how many there were.
TS.DELETERULEDeletes the compaction rule from sourceKey to destKey that TS.CREATERULE made.
TS.GETReturns the newest sample of the time series at key.
TS.INCRBYAdds a sample whose value is the series' last value plus value; a missing series starts at 0.
TS.INFOReturns 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.MADDAdds samples to one or more time series in one call, creating series that do not exist.
TS.MGETReturns the newest sample of every time series whose labels match the FILTER (see TS.MRANGE for conditions).
TS.MRANGERuns TS.RANGE over every time series whose labels match the FILTER, and returns each with its samples.
TS.MREVRANGERuns TS.REVRANGE over every time series whose labels match the FILTER, and returns each with its samples, newest first.
TS.NRANGERuns the same range over several named time series and joins the results by timestamp, a command of Redis 8.10.
TS.NREVRANGERuns the same range over several named time series and joins the results by timestamp, newest first.
TS.QUERYINDEXReturns the keys of every time series whose labels match all the given conditions, sorted by key.
TS.QUERYLABELSReturns 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.RANGEReturns the samples of the time series at key from fromTimestamp to toTimestamp, both included, oldest first.
TS.READReturns 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.REVRANGEReturns the samples of the time series at key from fromTimestamp to toTimestamp, both included, newest first.

Transactions

CommandSummary
DISCARDEnds 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.
EXECRuns 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.
MULTIStarts a transaction on this connection.
UNWATCHStops watching every key the connection watches with WATCH, so that the next EXEC no longer depends on them.
WATCHWatches 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

CommandSummary
VADDAdds an element with its vector to the vector set at key, or replaces an element's vector.
VCARDReturns the number of elements in the vector set at key.
VDIMReturns the number of dimensions of the vectors in the vector set at key.
VEMBReturns the vector of element in the vector set at key, as one number per dimension.
VGETATTRReturns the attributes of element in the vector set at key: the string set with VADD ... SETATTR or VSETATTR, as it was given.
VINFOReturns the vector set's dimensions, its number of elements, its quantization, its index type and its graph's levels.
VISMEMBERTells whether element is in the vector set at key: 1 if it is, 0 if not.
VLINKSReturns an element's nearest neighbours, up to 16, as one level; WITHSCORES gives their similarity, scored as VSIM scores it.
VRANDMEMBERReturns elements of the vector set at key, picked at random.
VRANGEReturns the elements of the vector set at key between two names in lexicographical order, with bounds as ZRANGEBYLEX takes them, and at most count.
VREMRemoves elements, with their vectors and attributes, from the vector set at key, and returns how many it removed.
VSETATTRSets the attributes of an element of the vector set at key, replacing any it had.
VSIMReturns the elements of the vector set at key most similar to a vector, most similar first.