List
LTRIM
Trim a list to the specified range
await redis.lpush("key", "a", "b", "c", "d");
await redis.ltrim("key", 1, 2);
// the list is now ["b", "c"]
Arguments
key
string
requiredThe key of the list.
start
number
requiredThe index of the first element to keep.
end
TValue
requiredThe 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"]