zlexcount
ZLEXCOUNT
Apply for Redis Developer Course
|
Redis Regular Inspection / Technical Support
|
Redis Enterprise Server
|
|---|
Count members in a lexicographical range
Usage: zlexcount key min max.
min and max are member bounds. Use -, + to query all members.
When specifying values for min/max, prefix them with [ or (.
Use [ to include the value and ( to exclude it.
This command requires all scores to be equal to get the intended result.
Example
| Command> | zrangebylex city - + |
| Result> |
0) Beijing 1) New Delhi 2) New York 3) Seoul |
| Command> | zlexcount city - + |
| Result> | 4 |
| Command> | zlexcount city "[New Delhi" + |
| Result> | 3 |
| Command> | zlexcount city "(New Delhi" + |
| Result> | 2 |
| Command> | zlexcount city "(New Delhi" "(Seoul" |
| Result> | 1 |
Syntax
ZLEXCOUNT key min max
- Available since version 2.8.9.
- Time complexity is O(log(N)). N is the number of members in the set.
| Related commands | ZRANGE, ZREVRANGE, ZREVRANGEBYSCORE, LRANGE |
| Clients for Java | Jedis, Lettuce, Redisson | Clients for C | Hiredis |
| << ZCOUNT | ZLEXCOUNT | ZRANK >> |
|---|
Email
답글이 올라오면 이메일로 알려드리겠습니다.
