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

Redis Zlexcount Command

Redis Zlexcount Command

Redis Sorted Set

The Redis Zlexcount command counts the number of members in the specified lexicographic range in the sorted set.

Syntax

The basic syntax of the redis Zlexcount command is as follows:



redis 127.0.0.1:6379> ZLEXCOUNT KEY MIN MAX

Available Version

= 2.8.9

Return Value

The number of members within the specified range.

Example



redis 127.0.0.1:6379> ZADD myzset 0 a 0 b 0 c 0 d 0 e

(integer) 5

redis 127.0.0.1:6379> ZADD myzset 0 f 0 g

(integer) 2

redis 127.0.0.1:6379> ZLEXCOUNT myzset - +

(integer) 7

redis 127.0.0.1:6379> ZLEXCOUNT myzset [b [f

(integer) 5

Redis Sorted Set