Redis Zlexcount Command

Redis Sorted Set (sorted set)

The Redis Zlexcount command counts the number of members within a specified lexicographical range in a 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 Versions

>= 2.8.9

Return Value

The number of members in the specified range.

Examples

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 (sorted set)

Other Extensions