assert redis.lpush("mylist", "one", "two", "three") == 3

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

Arguments

key
str
required
The key of the list.
elements
*List[Any]
required
One or more elements to push at the head of the list.

Response

The length of the list after the push operation.
assert redis.lpush("mylist", "one", "two", "three") == 3

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