COMMAND GETKEYS
COMMAND GETKEYS command [arg [arg ...]]
- Available since:
- Redis Open Source 2.8.13
- Time complexity:
- O(N) where N is the number of arguments to the command
- ACL categories:
-
@slow,@connection, - Compatibility:
- Redis Software and Redis Cloud compatibility
COMMAND GETKEYS is a helper command to let you find the keys
from the provided Redis command.
COMMAND describes how Redis identifies key names for each command, including firstkey, key specifications, and movablekeys. For some commands, Redis can identify the keys only by parsing the full command. Use COMMAND GETKEYS or COMMAND GETKEYSANDFLAGS to get the key names directly from the Redis command parser.
Required arguments
command
The name of the command to analyze.
Optional arguments
arg [arg ...]
The arguments that would be passed to the command.
Examples
redis> COMMAND GETKEYS MSET a b c d e f 1) "a" 2) "c" 3) "e" redis> COMMAND GETKEYS EVAL "not consulted" 3 key1 key2 key3 arg1 arg2 arg3 argN 1) "key1" 2) "key2" 3) "key3" redis> COMMAND GETKEYS SORT mylist ALPHA STORE outlist 1) "mylist" 2) "outlist"
Redis Software and Redis Cloud compatibility
| Redis Software |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Standard |
✅ Standard |
Return information
Array reply: list of keys from the given command.