Skip to content

Commit 438e8b1

Browse files
Add novalues option to HSCAN. (#2612)
Doc of redis/redis#12765. --------- Co-authored-by: Oran Agra <[email protected]>
1 parent aebf9fb commit 438e8b1

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

commands/scan.md

+19
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,25 @@ redis 127.0.0.1:6379> SCAN 0 TYPE zset
172172

173173
It is important to note that the **TYPE** filter is also applied after elements are retrieved from the database, so the option does not reduce the amount of work the server has to do to complete a full iteration, and for rare types you may receive no elements in many iterations.
174174

175+
## The NOVALUES option
176+
177+
When using `HSCAN`, you can use the `NOVALUES` option to make Redis return only the keys in the hash table without their corresponding values.
178+
179+
```
180+
redis 127.0.0.1:6379> HSET myhash a 1 b 2
181+
OK
182+
redis 127.0.0.1:6379> HSCAN myhash 0
183+
1) "0"
184+
2) 1) "a"
185+
2) "1"
186+
3) "b"
187+
4) "2"
188+
redis 127.0.0.1:6379> HSCAN myhash 0 NOVALUES
189+
1) "0"
190+
2) 1) "a"
191+
2) "b"
192+
```
193+
175194
## Multiple parallel iterations
176195

177196
It is possible for an infinite number of clients to iterate the same collection at the same time, as the full state of the iterator is in the cursor, that is obtained and returned to the client at every call. No server side state is taken at all.

0 commit comments

Comments
 (0)