HSCAN
HSCAN key cursor [MATCH pattern] [COUNT count] [NOVALUES]
- Available since:
- Redis Open Source 2.8.0
- Time complexity:
- O(1) for every call. O(N) for a complete iteration, including enough command calls for the cursor to return back to 0. N is the number of elements inside the collection.
- ACL categories:
-
@read,@hash,@slow, - Compatibility:
- Redis Software and Redis Cloud compatibility
See SCAN for HSCAN documentation.
Required arguments
key
The name of the key that holds the hash.
cursor
The cursor value. Start an iteration with 0, then use the cursor returned by each call as the argument to the next call.
Optional arguments
MATCH pattern
Only return fields whose names match the given glob-style pattern.
COUNT count
A hint for the number of fields to return per iteration. The default is 10.
NOVALUES
Return only the field names, without their values.
Redis Software and Redis Cloud compatibility
| Redis Software |
Redis Cloud |
Notes |
|---|---|---|
| ✅ Standard |
✅ Standard |
Return information
Array reply: a two-element array.
- The first element is a Bulk string reply that represents an unsigned 64-bit number, the cursor.
- The second element is an Array reply of field/value pairs that were scanned. When the
NOVALUESflag (since Redis 7.4) is used, only the field names are returned.