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

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"]