English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Redis Zscan Command

Redis Sorted Sets (sorted set)

The Redis Zscan command is used to iterate over the elements in an ordered set (including element members and element scores)

Syntax

Basic Syntax of Redis Zscan Command

redis 127.0.0.1:6379>  ZSCAN  key  cursor  [MATCH pattern]  [COUNT count]
  • cursor - Cursor.

  • pattern - Matching pattern.

  • count - Specify how many elements to return from the dataset, the default value is 10 .

Available Version

>= 2.8.0

Return Value

Each returned element is an ordered set element, which consists of a member(member) and a score.

Online Examples

>  ZADD  site 1 "Google" 2 "w3codebox" 3 "Taobao" 4 "Weibo"
(integer) 4
>  ZSCAN  site  0  match  "R*"
1)  "0"
2) 1)  "w3codebox"
2) 2.0

Redis Sorted Sets (sorted set)