Redis Zscan command
The Redis Zscan command is used to iterate over elements in a sorted set (including the element member and its score).
Syntax
The basic syntax of the redis Zscan command is as follows:
redis 127.0.0.1:6379> ZSCAN key cursor [MATCH pattern] [COUNT count]
- cursor - The cursor.
- pattern - The pattern to match.
- count - Specifies how many elements to return from the data set; the default value is 10.
Available Version
= 2.8.0
Return Value
Each returned element is a sorted set element, consisting of a member and a score.
Example
> ZADD site 1 "Google" 2 "Runoob" 3 "Taobao" 4 "Weibo"
(integer) 4
> ZSCAN site 0 match "R*"
1) "0"
2) 1) "Runoob"
2) 2.0
