What's new in Valkey 9.0? Discover new features and improvements. Read the announcement.

HSCAN

Iterates over fields and values of a hash.

Usage
HSCAN key cursor [MATCH pattern] [COUNT count] [NOVALUES novalues]
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.
Since
2.8.0
ACL Categories
@hash, @read, @slow
Command flags
READONLY

See SCAN for HSCAN documentation.

Replies

RESP2

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 NOVALUES option is on, a list of keys from the hash.

RESP3

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 NOVALUES option is on, a list of keys from the hash.