HSCAN
Note
Official reference: HSCAN.
Read one cursor batch of hash fields and values.
Syntax
HSCAN key cursor [MATCH pattern] [COUNT count] [NOVALUES]
Start with cursor 0. MATCH filters field names; COUNT hints at scan work; NOVALUES returns names only (requires Redis 7.4+).
Results
| Return | Rows | Content |
|---|---|---|
| ResultSet | multiple | CURSOR field, STRING type FIELD field, STRING type VALUE field, STRING type (when not using NOVALUES) |
Caution
The cursor is attached to each result row, so empty batches lose the continuation cursor. Use a Redis client for guaranteed complete traversal; an empty batch does not mean completion.
Example
HSET demo:user name mali age 18
HSCAN demo:user 0 MATCH n* COUNT 10