Lists in Redis

From the Redis cheat sheet ยท Data Structures ยท verified Jul 2026

Lists

Ordered collections of strings

bash
# Push elements
LPUSH mylist "first"      # Push to left (head)
RPUSH mylist "last"       # Push to right (tail)

# Pop elements
LPOP mylist              # Pop from left
RPOP mylist              # Pop from right

# Get elements
LRANGE mylist 0 -1       # Get all elements
LINDEX mylist 0          # Get element at index
LLEN mylist             # Get list length
๐Ÿ“ Doubly-linked lists for fast push/pop
๐Ÿ”„ O(1) for head/tail operations
๐Ÿ“Š Great for queues and stacks
โฐ Blocking operations for queue patterns

More Redis tasks

Back to the full Redis cheat sheet