scan_all_keys
Scans and returns all Redis keys matching a given pattern by automatically handling multiple SCAN iterations. Safer than KEYS * for large datasets, but may use significant memory.
Instructions
Scan and return ALL keys matching a pattern using multiple SCAN iterations.
This function automatically handles the SCAN cursor iteration to collect all matching keys. It's safer than KEYS * for large databases but will still collect all results in memory.
⚠️ WARNING: With very large datasets (millions of keys), this may consume significant memory. For large-scale operations, consider using scan_keys() with manual iteration instead.
Args: pattern: Pattern to match keys against (default is "*" for all keys). batch_size: Number of keys to scan per iteration (default 100).
Returns: A list of all keys matching the pattern or an error message.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pattern | No | * | |
| batch_size | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |