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
- New Content published on w3resource:
- HTML-CSS Practical: Exercises, Practice, Solution
- Java Regular Expression: Exercises, Practice, Solution
- Scala Programming Exercises, Practice, Solution
- Python Itertools exercises
- Python Numpy exercises
- Python GeoPy Package exercises
- Python Pandas exercises
- Python nltk exercises
- Python BeautifulSoup exercises
- Form Template
- Composer - PHP Package Manager
- PHPUnit - PHP Testing
- Laravel - PHP Framework
- Angular - JavaScript Framework
- Vue - JavaScript Framework
- Jest - JavaScript Testing Framework