zremrangebylex
ZREMRANGEBYLEX
Apply for Redis Developer Course
|
Redis Regular Inspection / Technical Support
|
Redis Enterprise Server
|
|---|
Delete members in a lexicographical range
Usage: zremrangebylex key min max.
min and max are member bounds. Use -, + to delete 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> | zadd city 0 "New Delhi" 0 "Seoul" 0 "Beijing" 0 "New York" |
| Result> | 4 |
| Command> | zrangebylex city - + |
| Result> |
0) Beijing 1) New Delhi 2) New York 3) Seoul |
| Command> | zremrangebylex city "(New Delhi" "(Seoul" |
| Result> | 1 |
| Command> | zrangebylex city - + |
| Result> |
0) Beijing 1) New Delhi 2) Seoul |
| Command> | zremrangebylex city "[New Delhi" "(Seoul" |
| Result> | 1 |
| Command> | zrangebylex city - + |
| Result> |
0) Beijing 1) Seoul |
| Command> | zremrangebylex city "[New Delhi" "[Seoul" |
| Result> | 1 |
| Command> | zrangebylex city - + |
| Result> |
0) Beijing |
Syntax
ZREMRANGEBYLEX key min max
- Available since version 2.8.9.
- Time complexity is O(log(N)+M). N is the number of members in the set, and, M is the number of members to delete.
| Related commands | ZRANGE, ZREVRANGE, ZREVRANGEBYSCORE, LRANGE |
| Clients for Java | Jedis, Lettuce, Redisson | Clients for C | Hiredis |
| << ZREMRANGEBYSCORE | ZREMRANGEBYLEX | ZUNION >> |
|---|
Email
답글이 올라오면 이메일로 알려드리겠습니다.
