Easy Tutorial
❮ Lists Lpushx Connection Echo ❯

Redis Zscan Command

Redis Sorted Set

The Redis Zscan command is used to iterate over the elements in a sorted set, including both the element members and their scores.

Syntax

The basic syntax for the redis Zscan command is as follows:

redis 127.0.0.1:6379> ZSCAN key cursor [MATCH pattern] [COUNT count]

Available Versions

= 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 "tutorialpro" 3 "Taobao" 4 "Weibo"
(integer) 4
> ZSCAN site 0 match "R*"
1) "0"
2) 1) "tutorialpro"
2) 2.0

Redis Sorted Set

❮ Lists Lpushx Connection Echo ❯