VALKEY-COMMANDS(7)
okay so bestie, welcome to valkey-commands(7) โ the full list of Valkey commands, no cap. ๐ this is the whole entire manual, and we're gonna go through every single group, fr fr. โจ
โจ NAME โจ
valkey-commands โ the full list of Valkey commands. that's the name, that's the vibe. ๐ซถ
๐ธ DESCRIPTION ๐ธ
Commands per group. let's get into it, bestie. ๐
๐ Bitmap
bitcount(3valkey)โ Counts the number of set bits (population counting) in a string. it's giving bit math, slay. ๐bitfield(3valkey)โ Performs arbitrary bitfield integer operations on strings. bitfield energy. โจbitfield_ro(3valkey)โ Performs arbitrary read-only bitfield integer operations on strings. read-only, bestie. no cap. ๐ซถbitop(3valkey)โ Performs bitwise operations on multiple strings, and stores the result. iconic. ๐bitpos(3valkey)โ Finds the first set (1) or clear (0) bit in a string. slay. ๐ฅgetbit(3valkey)โ Returns a bit value by offset. simple, cute. ๐setbit(3valkey)โ Sets or clears the bit at offset of the string value. Creates the key if it doesnโt exist. periodt. ๐
๐ฆ Cluster
asking(3valkey)โ Signals that a cluster client is following an -ASK redirect. it's giving redirect realness. โจcluster(3valkey)โ A container for Cluster commands. the whole cluster vibe. ๐cluster-addslots(3valkey)โ Assigns new hash slots to a node. slay. ๐cluster-addslotsrange(3valkey)โ Assigns new hash slot ranges to a node. ranges, bestie. ๐cluster-bumpepoch(3valkey)โ Advances the cluster config epoch. bump it. ๐ฅcluster-cancelslotmigrations(3valkey)โ Cancel all current ongoing slot migration operations. not me cancelling everything. ๐ญcluster-count-failure-reports(3valkey)โ Returns the number of active failure reports for a node. No new reports are created once the node is marked as failed. important. ๐cluster-countkeysinslot(3valkey)โ Returns the number of keys in a hash slot. count 'em. ๐cluster-delslots(3valkey)โ Sets hash slots as unbound for a node. unbound and unbothered. ๐ฆcluster-delslotsrange(3valkey)โ Sets hash slot ranges as unbound for a node. ranges too. โจcluster-failover(3valkey)โ Forces a replica to perform a manual failover of its primary. main character energy. ๐cluster-flushslots(3valkey)โ Deletes all slots information from a node. flush it. ๐cluster-forget(3valkey)โ Removes a node from the nodes table. forget them, periodt. ๐cluster-getkeysinslot(3valkey)โ Returns the key names in a hash slot. get those keys. ๐cluster-getslotmigrations(3valkey)โ Get the status of ongoing and recently finished slot import and export operations. the tea. โcluster-help(3valkey)โ Returns helpful text about the different subcommands. help a bestie out. ๐ซถcluster-info(3valkey)โ Returns information about the state of a node. the state of things. ๐ธcluster-keyslot(3valkey)โ Returns the hash slot for a key. which slot? this one. ๐cluster-links(3valkey)โ Returns a list of all TCP links to and from peer nodes. links, bestie. ๐cluster-meet(3valkey)โ Forces a node to handshake with another node. nice to meet you. ๐คcluster-migrateslots(3valkey)โ Migrate the given slots from this node to the specified nodes. move it, move it. ๐cluster-myid(3valkey)โ Returns the ID of a node. who am I? ๐cluster-myshardid(3valkey)โ Returns the shard ID of a node. shard identity. โจcluster-nodes(3valkey)โ Returns the cluster configuration for a node. the config. ๐cluster-replicas(3valkey)โ Lists the replica nodes of a primary node. the squad. ๐ฏcluster-replicate(3valkey)โ Configure a node as replica of a primary node or detach a replica from its primary. attach or detach, your call. ๐cluster-reset(3valkey)โ Resets a node. clean slate. ๐งผcluster-saveconfig(3valkey)โ Forces a node to save the cluster configuration to disk. save it for later. ๐พcluster-set-config-epoch(3valkey)โ Sets the configuration epoch for a new node. epoch set. โณcluster-setslot(3valkey)โ Binds a hash slot to a node. bound. ๐cluster-shards(3valkey)โ Returns the mapping of cluster slots to shards. mapping realness. ๐บ๏ธcluster-slaves(3valkey)โ Lists the replica nodes of a primary node. Deprecated. deprecated, bestie, so maybe don't. โ ๏ธcluster-slot-stats(3valkey)โ Return an array of slot usage statistics for slots assigned to the current node. stats, periodt. ๐cluster-slots(3valkey)โ Returns the mapping of cluster slots to nodes. slots to nodes. โจcluster-syncslots(3valkey)โ A container for internal slot migration commands. internal business. ๐คซreadonly(3valkey)โ Enables read-only queries for a connection to a Valkey replica node. read-only, cute. ๐readwrite(3valkey)โ Enables read-write queries for a connection to a Valkey replica node. read-write, slay. โ๏ธ
๐ Connection
auth(3valkey)โ Authenticates the connection. prove you belong. ๐client(3valkey)โ A container for client connection commands. the client zone. ๐client-caching(3valkey)โ Instructs the server whether to track the keys in the next request. track or not. ๐client-capa(3valkey)โ A client claims its capability. claim it. ๐ชclient-getname(3valkey)โ Returns the name of the connection. what's my name? ๐client-getredir(3valkey)โ Returns the client ID to which the connectionโs tracking notifications are redirected. redirect realness. ๐client-help(3valkey)โ Returns helpful text about the different subcommands. help a bestie. ๐ซถclient-id(3valkey)โ Returns the unique client ID of the connection. unique, like you. โจclient-import-source(3valkey)โ Mark this client as an import source when server is in import mode. import mode activated. ๐ฆclient-info(3valkey)โ Returns information about the connection. the info. ๐client-kill(3valkey)โ Terminates open connections. bye bestie. ๐client-list(3valkey)โ Lists open connections. the list. ๐client-no-evict(3valkey)โ Sets the client eviction mode of the connection. no evicting here. ๐ซclient-no-touch(3valkey)โ Controls whether commands sent by the client affect the LRU/LFU of accessed keys. don't touch. ๐client-pause(3valkey)โ Suspends commands processing. pause. โธ๏ธclient-reply(3valkey)โ Instructs the server whether to reply to commands. reply or not. ๐ฌclient-setinfo(3valkey)โ Sets information specific to the client or connection. set the info. ๐client-setname(3valkey)โ Sets the connection name. name it. ๐ท๏ธclient-tracking(3valkey)โ Controls server-assisted client-side caching for the connection. tracking on. ๐client-trackinginfo(3valkey)โ Returns information about server-assisted client-side caching for the connection. the tracking tea. โclient-unblock(3valkey)โ Unblocks a client blocked by a blocking command from a different connection. free them. ๐client-unpause(3valkey)โ Resumes processing commands from paused clients. unpause. โถ๏ธecho(3valkey)โ Returns the given string. echo echo echo. ๐ฃ๏ธhello(3valkey)โ Handshakes with the server. hi bestie. ๐ping(3valkey)โ Returns the serverโs liveliness response. are you alive? ๐quit(3valkey)โ Closes the connection. bye. โ๏ธreset(3valkey)โ Resets the connection. reset. ๐select(3valkey)โ Changes the selected database. switch it up. ๐
๐ Generic
copy(3valkey)โ Copies the value of a key to a new key. copy paste. ๐del(3valkey)โ Deletes one or more keys. delete it. ๐๏ธdump(3valkey)โ Returns a serialized representation of the value stored at a key. dump it. ๐ฆexists(3valkey)โ Determines whether one or more keys exist. do you exist? ๐คexpire(3valkey)โ Sets the expiration time of a key in seconds. tick tock. โฐexpireat(3valkey)โ Sets the expiration time of a key to a Unix timestamp. timestamp realness. ๐expiretime(3valkey)โ Returns the expiration time of a key as a Unix timestamp. when does it expire? ๐ฐ๏ธkeys(3valkey)โ Returns all key names that match a pattern. pattern matching, slay. ๐migrate(3valkey)โ Atomically transfers a key from one instance to another. move it atomically. ๐move(3valkey)โ Moves a key to another database. new database, who dis. ๐object(3valkey)โ A container for object introspection commands. introspect. ๐งobject-encoding(3valkey)โ Returns the internal encoding of an object. encoding tea. โobject-freq(3valkey)โ Returns the logarithmic access frequency counter of an object. frequency. ๐object-help(3valkey)โ Returns helpful text about the different subcommands. help. ๐ซถobject-idletime(3valkey)โ Returns the time since the last access to an object. idle time. ๐ดobject-refcount(3valkey)โ Returns the reference count of a value of a key. ref count. ๐ขpersist(3valkey)โ Removes the expiration time of a key. make it last forever. โพ๏ธpexpire(3valkey)โ Sets the expiration time of a key in milliseconds. milliseconds, precise. โฑ๏ธpexpireat(3valkey)โ Sets the expiration time of a key to a Unix milliseconds timestamp. millisecond timestamp. ๐pexpiretime(3valkey)โ Returns the expiration time of a key as a Unix milliseconds timestamp. when in ms? ๐ฐ๏ธpttl(3valkey)โ Returns the expiration time in milliseconds of a key. ttl in ms. โณrandomkey(3valkey)โ Returns a random key name from the database. surprise me. ๐ฒrename(3valkey)โ Renames a key and overwrites the destination. new name, who dis. ๐ท๏ธrenamenx(3valkey)โ Renames a key only when the target key name doesnโt exist. no overwrite. ๐ซrestore(3valkey)โ Creates a key from the serialized representation of a value. restore it. ๐พscan(3valkey)โ Iterates over the key names in the database. scan the vibes. ๐sort(3valkey)โ Sorts the elements in a list, a set, or a sorted set, optionally storing the result. sort it out. ๐ขsort_ro(3valkey)โ Returns the sorted elements of a list, a set, or a sorted set. read-only sort. ๐touch(3valkey)โ Returns the number of existing keys out of those specified after updating the time they were last accessed. touch grass, keys. ๐ฑttl(3valkey)โ Returns the expiration time in seconds of a key. ttl in seconds. โฐtype(3valkey)โ Determines the type of value stored at a key. what type? ๐unlink(3valkey)โ Asynchronously deletes one or more keys. delete but async. ๐๏ธwait(3valkey)โ Blocks until the asynchronous replication of all preceding write commands sent by the connection is completed. wait for it. โณwaitaof(3valkey)โ Blocks until all of the preceding write commands sent by the connection are written to the append-only file of the primary and/or replicas. wait for the AOF. ๐
๐ Geospatial indices
geoadd(3valkey)โ Adds one or more members to a geospatial index. The key is created if it doesnโt exist. geo vibes. ๐geodist(3valkey)โ Returns the distance between two members of a geospatial index. how far? ๐geohash(3valkey)โ Returns members from a geospatial index as geohash strings. hash it out. #๏ธโฃgeopos(3valkey)โ Returns the longitude and latitude of members from a geospatial index. coordinates. ๐georadius(3valkey)โ Queries a geospatial index for members within a distance from a coordinate, optionally stores the result. radius realness. ๐georadiusbymember(3valkey)โ Queries a geospatial index for members within a distance from a member, optionally stores the result. by member. ๐ฅgeoradiusbymember_ro(3valkey)โ Returns members from a geospatial index that are within a distance from a member. read-only version. ๐georadius_ro(3valkey)โ Returns members from a geospatial index that are within a distance from a coordinate. read-only radius. ๐geosearch(3valkey)โ Queries a geospatial index for members inside an area of a box, circle, or a polygon. search the geo. ๐geosearchstore(3valkey)โ Queries a geospatial index for members inside an area of a box, a circle, or a polygon, optionally stores the result. search and store. ๐พ
๐ Hash
hdel(3valkey)โ Deletes one or more fields and their values from a hash. Deletes the hash if no fields remain. bye fields. ๐๏ธhexists(3valkey)โ Determines whether a field exists in a hash. does it exist? ๐คhexpire(3valkey)โ Set expiry time on hash fields. expire those fields. โฐhexpireat(3valkey)โ Set expiry time on hash fields. at a specific time. ๐hexpiretime(3valkey)โ Returns Unix timestamps in seconds since the epoch at which the given keyโs field(s) will expire. when will they expire? ๐ฐ๏ธhget(3valkey)โ Returns the value of a field in a hash. get that field. ๐hgetall(3valkey)โ Returns all fields and values in a hash. all of it. โจhgetex(3valkey)โ Get the value of one or more fields of a given hash key, and optionally set their expiration time or time-to-live (TTL). get with options. ๐hincrby(3valkey)โ Increments the integer value of a field in a hash by a number. Uses 0 as initial value if the field doesnโt exist. math but make it hash. ๐ขhincrbyfloat(3valkey)โ Increments the floating point value of a field by a number. Uses 0 as initial value if the field doesnโt exist. float math. ๐งhkeys(3valkey)โ Returns all fields in a hash. all the keys. ๐hlen(3valkey)โ Returns the number of fields in a hash. how many? ๐ขhmget(3valkey)โ Returns the values of all fields in a hash. multiple values. ๐hmset(3valkey)โ Sets the values of multiple fields. set them all. ๐hpersist(3valkey)โ removes the existing expiration on a hash keyโs field(s). no cap, it just cancels the timer ๐hpexpire(3valkey)โ sets expiry time on hash object. bestie, itโs giving โthis hash expires in X msโ โจhpexpireat(3valkey)โ sets expiration time on hash field. like, specific timestamp vibes ๐hpexpiretime(3valkey)โ returns the Unix timestamp in milliseconds since Unix epoch at which the given keyโs field(s) will expire. so you know exactly when it dips ๐hpttl(3valkey)โ returns the remaining time to live in milliseconds of a hash keyโs field(s) that have an associated expiration. ms precision, periodt โณhrandfield(3valkey)โ returns one or more random fields from a hash. chaotic good energy ๐ฒhscan(3valkey)โ iterates over fields and values of a hash. lowkey a cursor walk ๐hset(3valkey)โ creates or modifies the value of a field in a hash. main character behavior ๐hsetex(3valkey)โ set the value of one or more fields of a given hash key, and optionally set their expiration time. two-for-one slay โจhsetnx(3valkey)โ sets the value of a field in a hash only when the field doesnโt exist. no overwrites, we respect boundaries ๐ โโ๏ธhstrlen(3valkey)โ returns the length of the value of a field. string length check, iykyk ๐httl(3valkey)โ returns the remaining time to live (in seconds) of a hash keyโs field(s) that have an associated expiration. seconds version, still valid ๐hvals(3valkey)โ returns all values in a hash. all the vibes, no fields ๐
โจ HYPERLOGLOG โจ
pfadd(3valkey)โ adds elements to a HyperLogLog key. creates the key if it doesnโt exist. no cap, itโs a set but approximate ๐pfcount(3valkey)โ returns the approximated cardinality of the set(s) observed by the HyperLogLog key(s). itโs giving estimates but make it fashion ๐pfdebug(3valkey)โ internal commands for debugging HyperLogLog values. devs only, bestie ๐ ๏ธpfmerge(3valkey)โ merges one or more HyperLogLog values into a single key. combining energies, slay โจpfselftest(3valkey)โ an internal command for testing HyperLogLog values. test test, is this thing on? ๐ค
โจ LIST โจ
blmove(3valkey)โ pops an element from a list, pushes it to another list and returns it. blocks until an element is available otherwise. deletes the list if the last element was moved. so dramatic, blocking behavior ๐blmpop(3valkey)โ pops the first element from one of multiple lists. blocks until an element is available otherwise. deletes the list if the last element was popped. multiple lists, one winner ๐blpop(3valkey)โ removes and returns the first element in a list. blocks until an element is available otherwise. deletes the list if the last element was popped. first one out, periodt ๐ฅbrpop(3valkey)โ removes and returns the last element in a list. blocks until an element is available otherwise. deletes the list if the last element was popped. last one, no cap ๐ฏbrpoplpush(3valkey)โ pops an element from a list, pushes it to another list and returns it. block until an element is available otherwise. deletes the list if the last element was popped. note: original says block, bestie ๐ซถlindex(3valkey)โ returns an element from a list by its index. index in, element out ๐linsert(3valkey)โ inserts an element before or after another element in a list. before or after, choose your fighter ๐ฅllen(3valkey)โ returns the length of a list. how many? this many ๐lmove(3valkey)โ returns an element after popping it from one list and pushing it to another. deletes the list if the last element was moved. move it, move it ๐บlmpop(3valkey)โ returns multiple elements from a list after removing them. deletes the list if the last element was popped. multiple pops, one command โจlpop(3valkey)โ returns and removes one or more elements from the beginning of a list. deletes the list if the last element was popped. start of the list, bestie ๐lpos(3valkey)โ returns the index of matching elements in a list. find that element, iykyk ๐lpush(3valkey)โ prepends one or more elements to a list. creates the key if it doesnโt exist. front of the line, no cuts ๐ถโโ๏ธlpushx(3valkey)โ prepends one or more elements to a list only when the list exists. only if it already exists, boundaries ๐lrange(3valkey)โ returns a range of elements from a list. slice it, serve it ๐ฐlrem(3valkey)โ removes elements from a list. deletes the list if the last element was removed. bye bye elements ๐lset(3valkey)โ sets the value of an element in a list by its index. replace that one, periodt ๐ltrim(3valkey)โ removes elements from both ends of a list. deletes the list if all elements were trimmed. trim the edges, iconic โ๏ธrpop(3valkey)โ returns and removes one or more elements from the end of a list. deletes the list if the last element was popped. end of the list, slay ๐rpoplpush(3valkey)โ returns the last element of a list after removing and pushing it to another list. deletes the list if the last element was popped. last element, new list, iconic โจrpush(3valkey)โ appends one or more elements to a list. creates the key if it doesnโt exist. back of the line, but make it fashion ๐rpushx(3valkey)โ appends one or more elements to a list only when the list exists. only if it exists, no cap ๐
โจ PUB/SUB โจ
psubscribe(3valkey)โ listens for messages published to channels that match one or more patterns. pattern matching vibes ๐publish(3valkey)โ posts a message to a channel. send it, bestie ๐จpubsub(3valkey)โ a container for Pub/Sub commands. the whole pubsub universe in one ๐ชpubsub-channels(3valkey)โ returns the active channels. whoโs active? these ones ๐pubsub-help(3valkey)โ returns helpful text about the different subcommands. help me help you ๐pubsub-numpat(3valkey)โ returns a count of unique pattern subscriptions. how many patterns? this many ๐งฎpubsub-numsub(3valkey)โ returns a count of subscribers to channels. subscriber count, periodt ๐ฅpubsub-shardchannels(3valkey)โ returns the active shard channels. shard channels, active and iconic โจpubsub-shardnumsub(3valkey)โ returns the count of subscribers of shard channels. shard subscriber count, iykyk ๐punsubscribe(3valkey)โ stops listening to messages published to channels that match one or more patterns. unsubscribe from patterns, bye ๐spublish(3valkey)โ post a message to a shard channel. shard channel post, no cap ๐จssubscribe(3valkey)โ listens for messages published to shard channels. shard channel listening, bestie ๐งsubscribe(3valkey)โ listens for messages published to channels. classic subscribe, main character ๐sunsubscribe(3valkey)โ stops listening to messages posted to shard channels. shard unsubscribe, periodt ๐ซunsubscribe(3valkey)โ stops listening to messages posted to channels. unsubscribe, we out ๐
โจ SCRIPTING AND FUNCTIONS โจ
eval(3valkey)โ executes a server-side Lua script. lua go brrr ๐evalsha(3valkey)โ executes a server-side Lua script by SHA1 digest. sha1 vibes, no cap ๐evalsha_ro(3valkey)โ executes a read-only server-side Lua script by SHA1 digest. read-only, sha1, slay ๐eval_ro(3valkey)โ executes a read-only server-side Lua script. read-only lua, bestie โจfcall(3valkey)โ invokes a function. call it, periodt ๐fcall_ro(3valkey)โ invokes a read-only function. read-only function call, iykyk ๐function(3valkey)โ a container for function commands. the function mothership ๐ธfunction-delete(3valkey)โ deletes a library and its functions. bye library, bye functions ๐function-dump(3valkey)โ dumps all libraries into a serialized binary payload. dump it, binary style ๐พfunction-flush(3valkey)โ deletes all libraries and functions. flush everything, dramatic ๐function-help(3valkey)โ returns helpful text about the different subcommands. help text, bestie ๐function-kill(3valkey)โ terminates a function during execution. kill it, but during execution ๐ญfunction-list(3valkey)โ returns information about all libraries. list all libraries, iconic ๐function-load(3valkey)โ creates a library. load that library, slay ๐function-restore(3valkey)โ restores all libraries from a payload. restore from payload, no cap โป๏ธfunction-stats(3valkey)โ returns information about a function during execution. stats while running, iykyk ๐script(3valkey)โ a container for Lua scripts management commands. script management mothership ๐ธscript-debug(3valkey)โ sets the debug mode of server-side Lua scripts. debug mode, on ๐script-exists(3valkey)โ determines whether server-side Lua scripts exist in the script cache. do they exist? check the cache ๐script-flush(3valkey)โ removes all server-side Lua scripts from the script cache. flush the cache, periodt ๐๏ธscript-help(3valkey)โ returns helpful text about the different subcommands. help me help you ๐script-kill(3valkey)โ terminates a server-side Lua script during execution. kill the script, dramatic ๐ญscript-load(3valkey)โ loads a server-side Lua script to the script cache. load it into cache, slay ๐ฅscript-show(3valkey)โ show server-side Lua script in the script cache. show me the script, bestie ๐
โจ SERVER โจ
acl(3valkey)โ a container for Access List Control commands. acl mothership ๐ธacl-cat(3valkey)โ lists the ACL categories, or the commands inside a category. categories or commands, iykyk ๐acl-deluser(3valkey)โ deletes ACL users, and terminates their connections. delete user, kill connections ๐acl-dryrun(3valkey)โ simulates the execution of a command by a user, without executing the command. dry run, no cap ๐งชacl-genpass(3valkey)โ generates a pseudorandom, secure password that can be used to identify ACL users. password generator, secure vibes ๐acl-getuser(3valkey)โ lists the ACL rules of a user. get user rules, periodt ๐acl-help(3valkey)โ returns helpful text about the different subcommands. help text, bestie ๐acl-list(3valkey)โ dumps the effective rules in ACL file format. dump rules, ACL format ๐พacl-load(3valkey)โ reloads the rules from the configured ACL file. reload from file, slay ๐acl-log(3valkey)โ lists recent security events generated due to ACL rules. security events, recent ones ๐acl-save(3valkey)โ saves the effective ACL rules in the configured ACL file. save rules to file, no cap ๐พacl-setuser(3valkey)โ creates and modifies an ACL user and its rules. create/modify user and rules, iconic โจacl-users(3valkey)โ lists all ACL users. all the users, periodt ๐ฅacl-whoami(3valkey)โ returns the authenticated username of the current connection. who am i? this user ๐bgrewriteaof(3valkey)โ asynchronously rewrites the append-only file to disk. async AOF rewrite, slay ๐พbgsave(3valkey)โ asynchronously saves the database(s) to disk. async save, no cap ๐พcommand(3valkey)โ returns detailed information about all commands. all the command info, iconic ๐command-count(3valkey)โ returns a count of commands. how many commands? this many ๐งฎcommand-docs(3valkey)โ returns documentary information about one, multiple or all commands. docs for commands, bestie ๐command-getkeys(3valkey)โ extracts the key names from an arbitrary command. get keys from command, iykyk ๐command-getkeysandflags(3valkey)โ extracts the key names and access flags for an arbitrary command. keys and flags, periodt ๐ฉcommand-help(3valkey)โ returns helpful text about the different subcommands. help text, slay ๐command-info(3valkey)โ returns information about one, multiple or all commands. command info, no cap ๐command-list(3valkey)โ returns a list of command names. list of names, iconic ๐commandlog(3valkey)โ a container for command log commands. command log mothership ๐ธcommandlog-get(3valkey)โ returns the specified command logโs entries. get log entries, bestie ๐commandlog-help(3valkey)โ show helpful text about the different subcommands. help text, periodt ๐commandlog-len(3valkey)โ returns the number of entries in the specified type of command log. how many entries? this many ๐งฎcommandlog-reset(3valkey)โ clears all entries from the specified type of command log. reset the log, bye entries ๐config(3valkey)โ a container for server configuration commands. config mothership ๐ธconfig-get(3valkey)โ returns the effective values of configuration parameters. get config values, no cap ๐config-help(3valkey)โ returns helpful text about the different subcommands. help text, bestie ๐config-resetstat(3valkey)โ resets the serverโs statistics. reset stats, periodt ๐config-rewrite(3valkey)โ persists the effective configuration to file. rewrite config to file, slay ๐พconfig-set(3valkey)โ sets configuration parameters in-flight. set config live, iykyk โ๏ธdbsize(3valkey)โ returns the number of keys in the database. how many keys? this many ๐ขdebug(3valkey)โ a container for debugging commands. debug mothership ๐failover(3valkey)โ starts a coordinated failover from a server to one of its replicas. failover time, dramatic ๐flushall(3valkey)โ removes all keys from all databases. delete everything, all databases ๐flushdb(3valkey)โ remove all keys from the current database. delete everything, current db ๐๏ธinfo(3valkey)โ returns information and statistics about the server. info and stats, bestie ๐lastsave(3valkey)โ returns the Unix timestamp of the last successful save to disk. last save timestamp, iykyk ๐latency(3valkey)โ a container for latency diagnostics commands. latency mothership ๐ธlatency-doctor(3valkey)โ returns a human-readable latency analysis report. doctor for latency, human-readable ๐ฉบlatency-graph(3valkey)โ returns a latency graph for an event. latency graph, visual vibes ๐latency-help(3valkey)โ returns helpful text about the different subcommands. help text, periodt ๐latency-histogram(3valkey)โ returns the cumulative distribution of latencies of a subset or all commands. histogram of latencies, slay ๐latency-history(3valkey)โ returns timestamp-latency samples for an event. history samples, timestamp-latency ๐ฐ๏ธlatency-latest(3valkey)โ returns the latest latency samples for all events. latest samples, no cap โฑ๏ธlatency-reset(3valkey)โ resets the latency data for one or more events. reset latency data, bye ๐lolwut(3valkey)โ displays computer art and the server version. lolwut? computer art + version, iconic ๐จmemory(3valkey)โ the whole container for all the memory diagnostics commands, it's giving brain-scan energy ๐ง โจmemory-doctor(3valkey)โ outputs a memory problems report, like a lil checkup for ur RAM ๐ฉบmemory-help(3valkey)โ returns helpful text about the different subcommands, iykyk when u forget the vibesmemory-malloc-stats(3valkey)โ returns the allocator statistics, all the numbers bestie ๐memory-purge(3valkey)โ asks the allocator to release memory, pls let it go ๐memory-stats(3valkey)โ returns details about memory usage, the receipts on ur RAM ๐memory-usage(3valkey)โ estimates the memory usage of a key, just a lil estimate thomodule(3valkey)โ a container for module commands, plug-in central ๐module-help(3valkey)โ returns helpful text about the different subcommandsmodule-list(3valkey)โ returns all loaded modules, the full roster โจmodule-load(3valkey)โ loads a module, bring it in ๐ซถmodule-loadex(3valkey)โ loads a module using extended parameters, the deluxe version ๐module-unload(3valkey)โ unloads a module, bye bestie ๐monitor(3valkey)โ listens for all requests received by the server in real-time, literally the nosiest command and I respect it ๐๐ฅpsync(3valkey)โ an internal command used in replication, not ur business fr frreplconf(3valkey)โ an internal command for configuring the replication stream, also internal, also mind ur own ๐replicaof(3valkey)โ configures a server as replica of another, or promotes it to a primary, glow-up or demotion, ur call ๐restore-asking(3valkey)โ an internal command for migrating keys in a cluster, internal bestierole(3valkey)โ returns the replication role, what's ur job rnsave(3valkey)โ synchronously saves the database(s) to disk, and yes it BLOCKS, so dramatic ๐shutdown(3valkey)โ synchronously saves the database(s) to disk and shuts down the server, the final boss move ๐ฅslaveof(3valkey)โ sets a server as a replica of another, or promotes it to being a primary. Deprecated. not me showing up late to the party ๐ซslowlog(3valkey)โ a container for slow log commands, the hall of shame for slow queries ๐ญslowlog-get(3valkey)โ returns the slow log's entries, read the receipts ๐slowlog-help(3valkey)โ show helpful text about the different subcommandsslowlog-len(3valkey)โ returns the number of entries in the slow log, how many L's are we takingslowlog-reset(3valkey)โ clears all entries from the slow log, fresh start bestie ๐ธswapdb(3valkey)โ swaps two databases, trading places, iconic behavior ๐sync(3valkey)โ an internal command used in replication, internal, move alongtime(3valkey)โ returns the server time, tick tock โฐ
โจ Set โจ
sadd(3valkey)โ adds one or more members to a set. Creates the key if it doesn't exist. no duplicates allowed, we don't do repeats here ๐scard(3valkey)โ returns the number of members in a set, the headcount ๐sdiff(3valkey)โ returns the difference of multiple sets, the "who's NOT in both" energysdiffstore(3valkey)โ stores the difference of multiple sets in a key, but keep it ๐พsinter(3valkey)โ returns the intersect of multiple sets, the overlap, the shared vibe โจsintercard(3valkey)โ returns the number of members of the intersect of multiple sets, just the count thosinterstore(3valkey)โ stores the intersect of multiple sets in a keysismember(3valkey)โ determines whether a member belongs to a set, are u in or are u out ๐ซถsmembers(3valkey)โ returns all members of a set, the whole squad ๐smismember(3valkey)โ determines whether multiple members belong to a set, group membership checksmove(3valkey)โ moves a member from one set to another, relocation arc ๐ฆspop(3valkey)โ returns one or more random members from a set after removing them. Deletes the set if the last member was popped. gone, reduced to atoms ๐srandmember(3valkey)โ get one or multiple random members from a set, surprise me ๐srem(3valkey)โ removes one or more members from a set. Deletes the set if the last member was removed. unfollowed ๐ญsscan(3valkey)โ iterates over members of a set, one by one, no rushsunion(3valkey)โ returns the union of multiple sets, everybody together now ๐sunionstore(3valkey)โ stores the union of multiple sets in a key
๐ธ Sorted Set ๐ธ
bzmpop(3valkey)โ removes and returns a member by score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped. it WAITS for u, so devoted ๐ญbzpopmax(3valkey)โ removes and returns the member with the highest score from one or more sorted sets. Blocks until a member available otherwise. Deletes the sorted set if the last element was popped.bzpopmin(3valkey)โ removes and returns the member with the lowest score from one or more sorted sets. Blocks until a member is available otherwise. Deletes the sorted set if the last element was popped.zadd(3valkey)โ adds one or more members to a sorted set, or updates their scores. Creates the key if it doesn't exist. ranked and rated ๐ฏzcard(3valkey)โ returns the number of members in a sorted set, the countzcount(3valkey)โ returns the count of members in a sorted set that have scores within a range, filtered count bestiezdiff(3valkey)โ returns the difference between multiple sorted sets, the leftoverszdiffstore(3valkey)โ stores the difference of multiple sorted sets in a keyzincrby(3valkey)โ increments the score of a member in a sorted set, glow-up by numbers ๐zinter(3valkey)โ returns the intersect of multiple sorted sets, the overlapzintercard(3valkey)โ returns the number of members of the intersect of multiple sorted setszinterstore(3valkey)โ stores the intersect of multiple sorted sets in a keyzlexcount(3valkey)โ returns the number of members in a sorted set within a lexicographical range, alphabet girlies rise ๐zmpop(3valkey)โ returns the highest- or lowest-scoring members from one or more sorted sets after removing them. Deletes the sorted set if the last member was popped.zmscore(3valkey)โ returns the score of one or more members in a sorted set, multiple scores at once, efficient queen ๐zpopmax(3valkey)โ returns the highest-scoring members from a sorted set after removing them. Deletes the sorted set if the last member was popped. top tier gets yeetedzpopmin(3valkey)โ returns the lowest-scoring members from a sorted set after removing them. Deletes the sorted set if the last member was popped. bottom tier, sorry bestie ๐zrandmember(3valkey)โ returns one or more random members from a sorted set, chaos but cute ๐ฒzrange(3valkey)โ returns members in a sorted set within a range of indexeszrangebylex(3valkey)โ returns members in a sorted set within a lexicographical rangezrangebyscore(3valkey)โ returns members in a sorted set within a range of scoreszrangestore(3valkey)โ stores a range of members from sorted set in a keyzrank(3valkey)โ returns the index of a member in a sorted set ordered by ascending scores, lowkey to highkey โจzrem(3valkey)โ removes one or more members from a sorted set. Deletes the sorted set if all members were removed.zremrangebylex(3valkey)โ removes members in a sorted set within a lexicographical range. Deletes the sorted set if all members were removed.zremrangebyrank(3valkey)โ removes members in a sorted set within a range of indexes. Deletes the sorted set if all members were removed.zremrangebyscore(3valkey)โ removes members in a sorted set within a range of scores. Deletes the sorted set if all members were removed.zrevrange(3valkey)โ returns members in a sorted set within a range of indexes in reverse order, backwards bestie ๐zrevrangebylex(3valkey)โ returns members in a sorted set within a lexicographical range in reverse orderzrevrangebyscore(3valkey)โ returns members in a sorted set within a range of scores in reverse orderzrevrank(3valkey)โ returns the index of a member in a sorted set ordered by descending scores, highkey to lowkeyzscan(3valkey)โ iterates over members and scores of a sorted set, members AND scores, double the infozscore(3valkey)โ returns the score of a member in a sorted set, just the numberzunion(3valkey)โ returns the union of multiple sorted sets, everyone invited ๐zunionstore(3valkey)โ stores the union of multiple sorted sets in a key
๐ฆ Stream ๐ฆ
xack(3valkey)โ returns the number of messages that were successfully acknowledged by the consumer group member of a stream, the "seen it, handled it" button โxadd(3valkey)โ appends a new message to a stream. Creates the key if it doesn't exist. new post dropped โจxautoclaim(3valkey)โ changes, or acquires, ownership of messages in a consumer group, as if the messages were delivered to as consumer group member.xclaim(3valkey)โ changes, or acquires, ownership of a message in a consumer group, as if the message was delivered a consumer group member.xdel(3valkey)โ returns the number of messages after removing them from a stream, delete but tell me how manyxgroup(3valkey)โ a container for consumer groups commandsxgroup-create(3valkey)โ creates a consumer group, new group chat bestie ๐ฌxgroup-createconsumer(3valkey)โ creates a consumer in a consumer group, adding a member to the gcxgroup-delconsumer(3valkey)โ deletes a consumer from a consumer group, removed from the chat ๐ญxgroup-destroy(3valkey)โ destroys a consumer group, the group chat is over frxgroup-help(3valkey)โ returns helpful text about the different subcommandsxgroup-setid(3valkey)โ sets the last-delivered ID of a consumer groupxinfo(3valkey)โ a container for stream introspection commands, look inward ๐งxinfo-consumers(3valkey)โ returns a list of the consumers in a consumer groupxinfo-groups(3valkey)โ returns a list of the consumer groups of a streamxinfo-help(3valkey)โ returns helpful text about the different subcommandsxinfo-stream(3valkey)โ returns information about a streamxlen(3valkey)โ return the number of messages in a stream, how many messages we got ๐ฌxpending(3valkey)โ returns the information and entries from a stream consumer group's pending entries list, the "still waiting on u" list ๐xrange(3valkey)โ returns the messages from a stream within a range of IDsxread(3valkey)โ returns messages from multiple streams with IDs greater than the ones requested. Blocks until a message is available otherwise. it waits, so patient ๐ซถxreadgroup(3valkey)โ returns new or historical messages from a stream for a consumer in a group. Blocks until a message is available otherwise.xrevrange(3valkey)โ returns the messages from a stream within a range of IDs in reverse orderxsetid(3valkey)โ an internal command for replicating stream values, internal bestiextrim(3valkey)โ deletes messages from the beginning of a stream, trimming from the front, not the end โ๏ธ
๐ String ๐
append(3valkey)โ appends a string to the value of a key. Creates the key if it doesn't exist. adding on, not replacing ๐decr(3valkey)โ decrements the integer value of a key by one. Uses 0 as initial value if the key doesn't exist. down bad by onedecrby(3valkey)โ decrements a number from the integer value of a key. Uses 0 as initial value if the key doesn't exist.delifeq(3valkey)โ delete key if value matches string, conditional delete, spicy ๐ถ๏ธget(3valkey)โ returns the string value of a key, the classic, the icon, the moment ๐getdel(3valkey)โ returns the string value of a key after deleting the key, read it then yeet itgetex(3valkey)โ returns the string value of a key after setting its expiration time, read it AND give it a deadline โณgetrange(3valkey)โ returns a substring of the string stored at a key, just a slice ๐ฐgetset(3valkey)โ returns the previous string value of a key after setting it to a new value, out with the old, in with the newincr(3valkey)โ increments the integer value of a key by one. Uses 0 as initial value if the key doesn't exist. up by one, slayincrby(3valkey)โ increments the integer value of a key by a number. Uses 0 as initial value if the key doesn't exist.incrbyfloat(3valkey)โ increment the floating point value of a key by a number. Uses 0 as initial value if the key doesn't exist. decimals bestie ๐งฎlcs(3valkey)โ finds the longest common substring, the shared lore between two strings ๐ซถmget(3valkey)โ atomically returns the string values of one or more keys, many gets, one trip โจmset(3valkey)โ atomically creates or modifies the string values of one or more keysmsetnx(3valkey)โ atomically modifies the string values of one or more keys only when all keys don't exist, all-or-nothing energy, and it only lands if NONE of them exist ๐psetex(3valkey)โ sets both the string value and the expiration time in milliseconds of a key. And if the key doesn't exist? It creates it. No cap. ๐set(3valkey)โ sets the string value of a key, literally ignoring its type. The key is created if it doesn't exist. โจsetex(3valkey)โ sets the string value and the expiration time of a key. Creates the key if it doesn't exist. Periodt. ๐setnx(3valkey)โ sets the string value of a key only when the key doesn't exist. Like, it's exclusive. ๐setrange(3valkey)โ overwrites a part of a string value with another one by an offset. Creates the key if it doesn't exist. Slay. ๐strlen(3valkey)โ returns the length of a string value. Simple. ๐ธsubstr(3valkey)โ returns a substring from a string value. Iconic. ๐
โจ Transactions โจ
discard(3valkey)โ discards a transaction. Bye bestie. ๐exec(3valkey)โ executes all commands in a transaction. Let's go! ๐ฅmulti(3valkey)โ starts a transaction. The beginning. ๐unwatch(3valkey)โ forgets about watched keys of a transaction. Memory loss but make it transactional. ๐ญwatch(3valkey)โ monitors changes to keys to determine the execution of a transaction. Big brother energy. ๐
SEE ALSO
And that's the tea, bestie! This page is from Valkey version 9.0.0, dated 2025-10-21, and it's page VALKEY-COMMANDS(7). Stay slaying. ๐
๐ฆ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 ยท CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 ยท CC-BY-SA-4.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms