tencent cloud

Tencent Cloud Observability Platform

Client.lPop

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 2025-03-11 20:05:00
The lPop method is used to remove and obtain the first element of the list.
lPop(key: string): string

Parameters

Parameter
Type
Description
key
string
Key name.

Return

Type
Description
string
On success, the first element in the list is 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");
console.log(redis lPush ${lPushResp}); // 1
let lPopResp = client.lPop("list");
console.log(redis lPop ${lPopResp}); // foo
}


Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan