Trim a list to the specified range
redis.rpush("mylist", "one", "two", "three") assert redis.ltrim("mylist", 0, 1) == True assert redis.lrange("mylist", 0, -1) == ["one", "two"]
The key of the list.
The index of the first element to keep.
Returns True if the list was trimmed, False otherwise.
True
False
Was this page helpful?