lRange(key: string, start, stop: number): string[]
Parameter | Type | Description |
key | string | Key name. |
start | string | Starting position. |
stop | string | End position. |
Type | Description |
string[] | On success, the elements in the interval [start, stop] are returned. |
import redis from "pts/redis";let client = new redis.Client("redis://:<password>@<host>:6379/0");export default function main() {let lPushResp = client.lPush("list", "foo", "bar", "zoo");console.log(redis lPush $
{
lPushResp
}
); // 3let lRangeResp = client.lRange("list", 0, 1);console.log(redis lRange $
{
lRangeResp
}
); // zoo,bar}