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
string
required
The key of the list.
start
number
required
The index of the first element to keep.
end
TValue
required
The index of the first element to keep.

Response

OK
await redis.lpush("key", "a", "b", "c", "d"); 
await redis.ltrim("key", 1, 2); 
// the list is now ["b", "c"]