> ## Documentation Index
> Fetch the complete documentation index at: https://upstash-dx-3081-agentkit-tanstack-ai-backends.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# KEYS

> Returns all keys matching pattern.

<Warning>
  This command can block the database for an extended period, especially with large datasets. We recommend using [SCAN](/redis/sdks/ts/commands/generic/scan) instead for production environments.

  This command will return an error for databases containing more than 100,000 entries.
</Warning>

## Arguments

<ParamField body="match" type="string" required>
  A glob-style pattern. Use `*` to match all keys.
</ParamField>

## Response

<ResponseField type="string[]" required>
  Array of keys matching the pattern.
</ResponseField>

<RequestExample>
  ```ts Example theme={null}
  const keys = await redis.keys("prefix*");
  ```

  ```ts Match All theme={null}
  const keys = await redis.keys("*");
  ```
</RequestExample>


## Related topics

- [KEYS](/redis/commands/generic/keys.md)
- [Keys](/qstash/sdks/py/examples/keys.md)
- [Key-Based Locking](/redis/features/key-locking.md)
- [Roll Your Signing Keys](/qstash/howto/roll-signing-keys.md)
