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
matchbodystringrequired
A glob-style pattern. Use * to match all keys.
Response
string[]required
Array of keys matching the pattern.
Example
const keys = await redis.keys("prefix*");Match All
const keys = await redis.keys("*");