Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Redis Zscan command

Redis Zscan command

Redis Sorted Set

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]

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

Redis Sorted Set