VALKEY-COMMAND-ARGUMENTS(7)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

✨ valkey-command-arguments(7) ✨

the one and only command-arguments page, fresh from the Valkey Manual πŸŽ€


🌸 NAME 🌸

valkey-command-arguments β€” Command arguments. That's it, that's the topic, and bestie it's a whole vibe πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

So the COMMAND DOCS command hands you documentation-flavored info about all the available Valkey commands, right? And the map reply it gives back has this key called arguments in it. That key is where an array lives, and that array describes the command's arguments. Periodt. ✨

Every single element in the arguments array is a map, and that map has these fields:

  • name β€” the argument's name, and it's always there, no exceptions. The name exists for identification purposes alone, okay? It is not displayed when the command's syntax gets rendered. Fun fact: the same name can pop up more than once across the whole argument tree, but it stays unique compared to its sibling arguments' names. Why does that matter? Because it lets you build a unique identifier for every argument β€” just concatenate all the names along the path from the root down to whatever argument you're looking at. Iconic. 🫢
  • display_text β€” the argument's display string. It's present in arguments that actually have a displayable representation (aka all arguments that aren't oneof/block). This is literally the string used in the command's syntax rendering.
  • type β€” the argument's type, always present, always required. An argument must be one of these:
    • string: a string argument.
    • integer: an integer argument.
    • double: a double-precision argument.
    • key: a string that represents the name of a key.
    • pattern: a string that represents a glob-like pattern.
    • unix-time: an integer that represents a Unix timestamp.
    • pure-token: the argument is a token, meaning a reserved keyword, which may or may not be provided. Do not confuse this with free-text user input, bestie, they are not the same thing πŸ’€
    • oneof: the argument is a container for nested arguments. This type lets you choose among several nested arguments (peep the XADD example below πŸ‘€).
    • block: the argument is a container for nested arguments too. This type lets you group arguments together and apply a property (like optional) to all of them (again, XADD example below πŸ‘‡).
  • key_spec_index β€” this value shows up for every argument of the key type. It's a 0-based index of the specification in the command's key specifications that corresponds to the argument.
  • token β€” a constant literal that precedes the argument (the user input) itself.
  • summary β€” a short description of the argument.
  • since β€” the debut Redis OSS version of the argument (or, for module commands, the module version).
  • deprecated_since β€” the Redis OSS version that deprecated the command (or, for module commands, the module version).
  • flags β€” an array of argument flags. The possible flags are:
    • optional: denotes that the argument is optional (for example, the GET clause of the SET command).
    • multiple: denotes that the argument may be repeated (such as the key argument of DEL).
    • multiple-token: denotes the possible repetition of the argument with its preceding token (see SORT's GET pattern clause).
  • value β€” the argument's value. For argument types other than oneof and block, this is a string that describes the value in the command's syntax. For the oneof and block types, this is an array of nested arguments, and each one of those is a map exactly as described in this section. Recursion, but make it cute 🧚

🌈 Example 🌈

The trimming clause of XADD, like, [MAXLEN|MINID [=|~] threshold [LIMIT count]], is represented at the top-level as a block-typed argument.

It's made of four nested arguments:

  1. trimming strategy: this nested argument has an oneof type with two nested arguments. Each of those nested arguments, MAXLEN and MINID, is typed as pure-token.
  2. trimming operator: this nested argument is an optional oneof type with two nested arguments. Each of those nested arguments, = and ~, is a pure-token.
  3. threshold: this nested argument is a string.
  4. count: this nested argument is an optional integer with a token (LIMIT).

And here's XADD's arguments array, in all its glory πŸ”₯:

1) 1) "name"
   2) "key"
   3) "type"
   4) "key"
   5) "value"
   6) "key"
2)  1) "name"
    2) "nomkstream"
    3) "type"
    4) "pure-token"
    5) "token"
    6) "NOMKSTREAM"
    7) "since"
    8) "6.2"
    9) "flags"
   10) 1) optional
3) 1) "name"
   2) "trim"
   3) "type"
   4) "block"
   5) "flags"
   6) 1) optional
   7) "value"
   8) 1) 1) "name"
         2) "strategy"
         3) "type"
         4) "oneof"
         5) "value"
         6) 1) 1) "name"
               2) "maxlen"
               3) "type"
               4) "pure-token"
               5) "token"
               6) "MAXLEN"
            2) 1) "name"
               2) "minid"
               3) "type"
               4) "pure-token"
               5) "token"
               6) "MINID"
               7) "since"
               8) "6.2"
      2) 1) "name"
         2) "operator"
         3) "type"
         4) "oneof"
         5) "flags"
         6) 1) optional
         7) "value"
         8) 1) 1) "name"
               2) "equal"
               3) "type"
               4) "pure-token"
               5) "token"
               6) "="
            2) 1) "name"
               2) "approximately"
               3) "type"
               4) "pure-token"
               5) "token"
               6) "~"
      3) 1) "name"
         2) "threshold"
         3) "type"
         4) "string"
         5) "value"
         6) "threshold"
      4)  1) "name"
          2) "count"
          3) "type"
          4) "integer"
          5) "token"
          6) "LIMIT"
          7) "since"
          8) "6.2"
          9) "flags"
         10) 1) optional
         11) "value"
         12) "count"
4) 1) "name"
   2) "id_or_auto"
   3) "type"
   4) "oneof"
   5) "value"
   6) 1) 1) "name"
         2) "auto_id"
         3) "type"
         4) "pure-token"
         5) "token"
         6) "*"
      2) 1) "name"
         2) "id"
         3) "type"
         4) "string"
         5) "value"
         6) "id"
5) 1) "name"
   2) "field_value"
   3) "type"
   4) "block"
   5) "flags"
   6) 1) multiple
   7) "value"
   8) 1) 1) "name"
         2) "field"
         3) "type"
         4) "string"
         5) "value"
         6) "field"
      2) 1) "name"
         2) "value"
         3) "type"
         4) "string"
         5) "value"
         6) "value"

okay that's the whole page, you understood all of it, you ate πŸ’…

this little love letter comes to you from version 9.0.0, dated 2025-10-21, straight out of the Valkey Manual πŸŽ€βœ¨

πŸ“¦ where this page comes from