ZREMRANGEBYLEX

Since 1.1.0Sorted sets

Syntax

ZREMRANGEBYLEX key min max
  • Flags: write
  • ACL categories: @slow, @sortedset, @write
  • Arity: 4

Removes the members of the sorted set at key between min and max in lexicographical order, with bounds as ZRANGEBYLEX takes them.

Reply

  • The number of members removed.

Examples

> ZADD lx 0 apple 0 banana 0 cherry 0 date
(integer) 4
> ZREMRANGEBYLEX lx [a (c
(integer) 2
> ZRANGE lx 0 -1
1) "cherry"
2) "date"