LREM key count element

    Time complexity: O(N+M) where N is the length of the list and M is the number of elements removed.

    Removes the first occurrences of elements equal to element from the list stored at key. The count argument influences the operation in the following ways:

    • count < 0: Remove elements equal to element moving from tail to head.
    • count = 0: Remove all elements equal to element.

    For example, will remove the last two occurrences of "hello" in the list stored at list.

    : the number of removed elements.

    *Examples

    redis> RPUSH mylist "hello"

    redis> RPUSH mylist "hello"

      redis> RPUSH mylist "hello"

      1. (integer) 4

      redis> LREM mylist -2 "hello"

      redis> LRANGE mylist 0 -1

      1. 1) "hello"
      redis>