Redis Sorted Sets: ZREMRANGEBYLEX
ZREMRANGEBYLEX key min max
Redis ZREMRANGEBYLEX command is used to remove all elements in the sorted set stored at key between the lexicographical range specified by minimum and maximum values, when all the elements in a sorted set are inserted with the same score, in order to force lexicographical ordering.
Syntax:
ZREMRANGEBYLEX key min max
Available since
2.8.9.
Return Value
Integer reply, the number of elements removed.
Return Value Type
Integer
Example: Redis ZREMRANGEBYLEX
127.0.0.1:6379> ZADD mycityset 0 Delhi 0 Mumbai 0 Hyderabad 0 Kolkata 0 Chennai (integer) 5 127.0.0.1:6379> ZRANGEBYLEX mycityset - + 1) "Chennai" 2) "Delhi" 3) "Hyderabad" 4) "Kolkata" 5) "Mumbai" 127.0.0.1:6379> ZREMRANGEBYLEX mycityset "(Hyderabad" "(Mumbai" (integer) 1 127.0.0.1:6379> ZRANGEBYLEX mycityset - + 1) "Chennai" 2) "Delhi" 3) "Hyderabad" 4) "Mumbai" 127.0.0.1:6379> ZREMRANGEBYLEX mycityset "[Hyderabad" "(Mumbai" (integer) 1 127.0.0.1:6379> ZRANGEBYLEX mycityset - + 1) "Chennai" 2) "Delhi" 3) "Mumbai" 127.0.0.1:6379> ZREMRANGEBYLEX mycityset "[Hyderabad" "[Mumbai" (integer) 1 127.0.0.1:6379> ZRANGEBYLEX mycityset - + 1) "Chennai" 2) "Delhi"
Previous:
ZREM
Next:
ZREMRANGEBYRANK
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics