tencent cloud

Performance Testing Service

Related Agreements
Service Level Agreement
Use Limits
Privacy Policy
Data Processing And Security Agreement
DokumentasiPerformance Testing Service

Client.lRange

Mode fokus
Ukuran font
Terakhir diperbarui: 2025-03-10 17:15:08
The lRange method is used to obtain elements within the specified range from the list.
lRange(key: string, start, stop: number): string[]

Parameters

Parameter
Type
Description
key
string
Key name.
start
string
Starting position.
stop
string
End position.

Return

Type
Description
string[]
On success, the elements in the interval [start, stop] are returned.

Samples

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}); // 3
let lRangeResp = client.lRange("list", 0, 1);
console.log(redis lRange ${lRangeResp}); // zoo,bar
}


Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan