VALKEY-COMMANDS(7)

๐Ÿ“ฆ
version 9.0.6 ยท 2 versions
, in fedora 44

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

๐Ÿ’œ 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 vibes
  • memory-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 tho
  • module(3valkey) โ€” a container for module commands, plug-in central ๐Ÿ”Œ
  • module-help(3valkey) โ€” returns helpful text about the different subcommands
  • module-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 fr
  • replconf(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 bestie
  • role(3valkey) โ€” returns the replication role, what's ur job rn
  • save(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 subcommands
  • slowlog-len(3valkey) โ€” returns the number of entries in the slow log, how many L's are we taking
  • slowlog-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 along
  • time(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" energy
  • sdiffstore(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 tho
  • sinterstore(3valkey) โ€” stores the intersect of multiple sets in a key
  • sismember(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 check
  • smove(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 rush
  • sunion(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 count
  • zcount(3valkey) โ€” returns the count of members in a sorted set that have scores within a range, filtered count bestie
  • zdiff(3valkey) โ€” returns the difference between multiple sorted sets, the leftovers
  • zdiffstore(3valkey) โ€” stores the difference of multiple sorted sets in a key
  • zincrby(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 overlap
  • zintercard(3valkey) โ€” returns the number of members of the intersect of multiple sorted sets
  • zinterstore(3valkey) โ€” stores the intersect of multiple sorted sets in a key
  • zlexcount(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 yeeted
  • zpopmin(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 indexes
  • zrangebylex(3valkey) โ€” returns members in a sorted set within a lexicographical range
  • zrangebyscore(3valkey) โ€” returns members in a sorted set within a range of scores
  • zrangestore(3valkey) โ€” stores a range of members from sorted set in a key
  • zrank(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 order
  • zrevrangebyscore(3valkey) โ€” returns members in a sorted set within a range of scores in reverse order
  • zrevrank(3valkey) โ€” returns the index of a member in a sorted set ordered by descending scores, highkey to lowkey
  • zscan(3valkey) โ€” iterates over members and scores of a sorted set, members AND scores, double the info
  • zscore(3valkey) โ€” returns the score of a member in a sorted set, just the number
  • zunion(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 many
  • xgroup(3valkey) โ€” a container for consumer groups commands
  • xgroup-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 gc
  • xgroup-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 fr
  • xgroup-help(3valkey) โ€” returns helpful text about the different subcommands
  • xgroup-setid(3valkey) โ€” sets the last-delivered ID of a consumer group
  • xinfo(3valkey) โ€” a container for stream introspection commands, look inward ๐Ÿง˜
  • xinfo-consumers(3valkey) โ€” returns a list of the consumers in a consumer group
  • xinfo-groups(3valkey) โ€” returns a list of the consumer groups of a stream
  • xinfo-help(3valkey) โ€” returns helpful text about the different subcommands
  • xinfo-stream(3valkey) โ€” returns information about a stream
  • xlen(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 IDs
  • xread(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 order
  • xsetid(3valkey) โ€” an internal command for replicating stream values, internal bestie
  • xtrim(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 one
  • decrby(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 it
  • getex(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 new
  • incr(3valkey) โ€” increments the integer value of a key by one. Uses 0 as initial value if the key doesn't exist. up by one, slay
  • incrby(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 keys
  • msetnx(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