tencent cloud

Tencent Cloud Observability Platform

Client.lPush

PDF
フォーカスモード
フォントサイズ
最終更新日: 2025-03-11 20:05:00
The lPush method is used to insert one or more values at the head of the list.
lPush(key: string, ...values: (string | number)[]): number

Parameters

Parameter
Type
Description
key
string
Key name.
...values
(string | number)[]
Value.

Return

Type
Description
number
On success, the length of the list after insertion 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
}


ヘルプとサポート

この記事はお役に立ちましたか?

フィードバック