Generic
KEYS
Returns all keys matching pattern.
This command can block the database for an extended period, especially with large datasets. We recommend using SCAN instead for production environments.
This command will return an error for databases containing more than 100,000 entries.
Arguments
matchbodystrrequired
A glob-style pattern. Use * to match all keys.
Response
List[str]
Array of keys matching the pattern.
Example
keys = redis.keys("prefix*")Match All
keys = redis.keys("*")