Extracts the key names and access flags for an arbitrary command.
COMMAND
GETKEYSANDFLAGS
command
arg [arg…]
Returns @array-reply of keys from a full Valkey command and their usage flags.
COMMAND GETKEYSANDFLAGS
is a helper command to let you
find the keys from a full Valkey command together with flags indicating
what each key is used for.
COMMAND
provides information on how to find the key
names of each command (see firstkey
, key
specifications, and movablekeys
), but in some cases
it’s not possible to find keys of certain commands and then the entire
command must be parsed to discover some / all key names. You can use
COMMAND GETKEYS
or COMMAND GETKEYSANDFLAGS
to
discover key names directly from how Valkey parses the commands.
Refer to key specifications for information about the meaning of the key flags.
Array reply: a list of keys from the given command and their usage flags.
O(N) where N is the number of arguments to the command
@connection @slow
127.0.0.1:6379> COMMAND GETKEYS MSET a b c d e f
1) "a"
2) "c"
3) "e"
127.0.0.1:6379> COMMAND GETKEYS EVAL "not consulted" 3 key1 key2 key3 arg1 arg2 arg3 argN
1) "key1"
2) "key2"
3) "key3"
127.0.0.1:6379> COMMAND GETKEYSANDFLAGS LMOVE mylist1 mylist2 left left
1) 1) "mylist1"
2) 1) RW
2) access
3) delete
2) 1) "mylist2"
2) 1) RW
2) insert
ACL, ACL CAT, ACL DELUSER, ACL DRYRUN, ACL GENPASS, ACL GETUSER, ACL HELP, ACL LIST, ACL LOAD, ACL LOG, ACL SAVE, ACL SETUSER, ACL USERS, ACL WHOAMI, BGREWRITEAOF, BGSAVE, COMMAND, COMMAND COUNT, COMMAND DOCS, COMMAND GETKEYS, COMMAND HELP, COMMAND INFO, COMMAND LIST, CONFIG, CONFIG GET, CONFIG HELP, CONFIG RESETSTAT, CONFIG REWRITE, CONFIG SET, DBSIZE, DEBUG, FAILOVER, FLUSHALL, FLUSHDB, INFO, LASTSAVE, LATENCY, LATENCY DOCTOR, LATENCY GRAPH, LATENCY HELP, LATENCY HISTOGRAM, LATENCY HISTORY, LATENCY LATEST, LATENCY RESET, LOLWUT, MEMORY, MEMORY DOCTOR, MEMORY HELP, MEMORY MALLOC-STATS, MEMORY PURGE, MEMORY STATS, MEMORY USAGE, MODULE, MODULE HELP, MODULE LIST, MODULE LOAD, MODULE LOADEX, MODULE UNLOAD, MONITOR, PSYNC, REPLCONF, REPLICAOF, RESTORE-ASKING, ROLE, SAVE, SHUTDOWN, SLOWLOG, SLOWLOG GET, SLOWLOG HELP, SLOWLOG LEN, SLOWLOG RESET, SWAPDB, SYNC, TIME.