COMMAND
COMMAND COMMAND subcommand [argument ...]
- Group
- Server
- Complexity
- O(N) where N is the number of commands
- Arity
- -1 (at least 1 words, counting the command name)
- Flags
- read-only, loading
- HotKV Cloud
- All plans
- On-Premise
- no license needed
COMMAND without arguments describes every command the server has, in the
same format as COMMAND INFO. Cluster-aware client
libraries read it at startup to learn where each command’s keys are, so they
can send the command to the right node.
The subcommands below answer narrower questions. COMMAND HELP lists them.
Subcommands
Section titled “Subcommands”| Subcommand | What it does |
|---|---|
| COMMAND COUNT | How many commands there are. |
| COMMAND LIST | Every command and subcommand name, optionally filtered. |
| COMMAND INFO | Arity, flags, key positions and ACL categories of commands. |
| COMMAND DOCS | A short documentation entry per command. |
| COMMAND GETKEYS | The keys a full command line would use. |
| COMMAND GETKEYSANDFLAGS | The keys, and whether each is read or written. |
An unknown subcommand gets ERR unknown subcommand '<name>'.
Return value
Section titled “Return value”An array with one entry per command, as described on COMMAND INFO.
Examples
Section titled “Examples”127.0.0.1:6379> COMMAND 1) 1) "get" 2) (integer) 2 3) 1) "readonly" 2) "fast" 4) (integer) 1 5) (integer) 1 6) (integer) 1 7) 1) "@read" 2) "@string" 3) "@fast" 2) ...Compatibility
Section titled “Compatibility”Redis 7 and Valkey 8 add three more elements to each entry (tips, key
specifications and subcommands). HotKV returns the first seven, which is
what client libraries use for routing. The commands HotKV adds (for example
PCACHE.GET) are included.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.