LREM
Since 1.1.0Lists
Syntax
LREM key count elementRemoves elements equal to element from the list at key:
countgreater than 0: the firstcountof them, from the head;countless than 0: the last-countof them, from the tail;count0: all of them.
Reply
- The number of elements removed.
Examples
> RPUSH r a b a c a
(integer) 5
> LREM r 2 a
(integer) 2
> LRANGE r 0 -1
1) "b"
2) "c"
3) "a"
> RPUSH r2 a b a c a
(integer) 5
> LREM r2 -1 a
(integer) 1