Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

COMMAND GETKEYSANDFLAGS

Last updated
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.

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.

127.0.0.1:6379> COMMAND GETKEYSANDFLAGS GET user:1
1) 1) "user:1"
2) 1) "RO"
2) "access"
127.0.0.1:6379> COMMAND GETKEYSANDFLAGS SET user:1 alice
1) 1) "user:1"
2) 1) "OW"
2) "update"

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.

COMMAND GETKEYS, COMMAND INFO