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.
direction
"BEFORE" | "AFTER"
required
Whether to insert the element before or after pivot.
pivot
Any
required
The element to insert before or after.
value
Any
required
The element to insert.

Response

The list length after insertion, 0 when the list doesn’t exist or -1 when pivot was not found.
redis.rpush("key", "a", "b", "c")
redis.linsert("key", "before", "b", "x")