COMMAND GETKEYSANDFLAGS
COMMAND GETKEYSANDFLAGS command [argument ...]
- Group
- Server
- Complexity
- O(N) where N is the number of arguments
- Arity
- -3 (at least 3 words, counting the command name)
- HotKV Cloud
- All plans
- On-Premise
- no license needed
COMMAND GETKEYSANDFLAGS works like COMMAND GETKEYS
and also says how the command uses each key. Nothing is run.
Return value
Section titled “Return value”An array with one entry per key, each an array of the key and its flags, in RESP2 and RESP3. The flags come from the command as a whole, so every key of a command gets the same ones:
| Command | Flags |
|---|---|
| Reads data only | RO, access |
| Writes data | OW, update |
| Reads and writes data | RW, access |
The errors are those of COMMAND GETKEYS.
Examples
Section titled “Examples”127.0.0.1:6379> COMMAND GETKEYSANDFLAGS GET user:11) 1) "user:1" 2) 1) "RO" 2) "access"127.0.0.1:6379> COMMAND GETKEYSANDFLAGS SET user:1 alice1) 1) "user:1" 2) 1) "OW" 2) "update"Compatibility
Section titled “Compatibility”Same reply shape as Redis 7 and Valkey 8. Redis derives the flags of each
key from per-key specifications, so it can give different keys of one
command different flags (for example the source and destination of
COPY) and adds flags such as insert or delete. HotKV
gives every key of a command the same, coarser flags shown above.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.