ZREMRANGEBYLEX command in redis

ZREMRANGEBYLEX key min max

Removes all members in a sorted set between the given lexicographical range

Redis ZREMRANGEBYLEX command removes all the elements in the sorted set stored at the key between the lexicographical range specified by min and max.

RETURN VALUE

Integer reply, i.e the number of elements removed.

Syntax

ZREMRANGEBYLEX key min max

Example 

redis:6379> ZADD mykey 0 A 2 C 3 D 1 E
(integer) 4
redis:6379> ZREMRANGEBYLEX mykey - [D
(integer) 1
redis:6379> ZREMRANGEBYLEX mykey - (a
(integer) 3


No comments:

Post a Comment