Skip to main content

Documentation Index

Fetch the complete documentation index at: https://upstash.com/docs/llms.txt

Use this file to discover all available pages before exploring further.

Arguments

key
str
required
The key of the list.
count
number
required
How many occurrences of the element to remove.
element
Any
required
The element to remove

Response

The number of elements removed.
redis.rpush("mylist", "one", "two", "three", "two", "one")

assert redis.lrem("mylist", 2, "two") == 2

assert redis.lrange("mylist", 0, -1) == ["one", "three", "one"]