KEYS
Note
Official reference: KEYS.
Find matching keys; the driver iterates with SCAN.
Syntax
KEYS pattern
pattern uses Redis glob matching, such as demo:*. fetchSize supplies the SCAN COUNT hint; maxRows caps total returned rows. Traversal is unordered and concurrent changes can produce duplicates.
Results
| Return | Rows | Content |
|---|---|---|
| ResultSet | multiple | KEY field, STRING type (Note: the driver uses the scan command instead of the keys command) |
Example
SET demo:message hello
KEYS demo:*