w3resource

Redis Server: COMMAND GETKEYS

Redis COMMAND GETKEYS

Redis COMMAND GETKEYS is used to return an array reply of keys from a full Redis command. and also helps to find the keys from a full Redis command.

Here are some common uses and scenarios for the "COMMAND GETKEYS" command:

  • Key Extraction: Extracts the keys referenced by a command, useful for understanding which keys a command will affect.
  • Debugging: Helps in debugging by showing which keys are involved in the execution of a given command.
  • Command Analysis: Assists in analyzing the impact of commands on specific keys, improving query planning and optimization.
  • Monitoring: Useful for monitoring key access patterns and understanding how commands interact with data in Redis.
  • Documentation: Aids in documenting commands by providing clarity on which keys are manipulated by each command.

Syntax:

COMMAND GETKEYS

Available since

2.8.13.

Return Value

Array reply,a list of keys from your command.

Return Value Type

Array

Example: Redis COMMAND GETKEYS

redis 127.0.0.1:6379> COMMAND GETKEYS MSET a b c d e f 
1) "a"
2) "c"
3) "e"

Previous: COMMAND COUNT
Next: COMMAND INFO



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://www.w3resource.com/redis/redis-server-command-getkeys.php