List

LRANGE

Returns the specified elements of the list stored at key.

Arguments

keybodystringrequired

The key of the list.

startbodyintegerrequired

The starting index of the range to return.

Use negative numbers to specify offsets starting at the end of the list.

endbodyintegerrequired

The ending index of the range to return.

Use negative numbers to specify offsets starting at the end of the list.

Response

TValue[]required

The list of elements in the specified range.

Example
await redis.lpush("key", "a", "b", "c"); const elements = await redis.lrange("key", 1, 2); console.log(elements) // ["b", "c"]
Loading search…