zscan.3valkey - Man Page
Iterates over members and scores of a sorted set.
Synopsis
ZSCAN
key cursor [MATCH
pattern] [COUNT
count] [NOSCORES
]
See SCAN
for ZSCAN
documentation.
Reply
valkey-protocol(7) Array reply: a two-element array.
- The first element is a valkey-protocol(7) Bulk string reply that represents an unsigned 64-bit number, the cursor.
- The second element is an valkey-protocol(7) Array reply of member/score pairs that were scanned. When
NOSCORES
option is on, a list of members from the sorted set.
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 @slow @sortedset
History
- Available since: 2.8.0
- Changed in 8.0.0: Added noscores option.
See Also
bzmpop(3valkey), bzpopmax(3valkey), bzpopmin(3valkey), zadd(3valkey), zcard(3valkey), zcount(3valkey), zdiff(3valkey), zdiffstore(3valkey), zincrby(3valkey), zinter(3valkey), zintercard(3valkey), zinterstore(3valkey), zlexcount(3valkey), zmpop(3valkey), zmscore(3valkey), zpopmax(3valkey), zpopmin(3valkey), zrandmember(3valkey), zrange(3valkey), zrangestore(3valkey), zrank(3valkey), zrem(3valkey), zremrangebylex(3valkey), zremrangebyrank(3valkey), zremrangebyscore(3valkey), zrevrank(3valkey), zscore(3valkey), zunion(3valkey), zunionstore(3valkey)