tencent cloud

Performance Testing Service

Related Agreements
Service Level Agreement
Use Limits
Privacy Policy
Data Processing And Security Agreement
DocumentaçãoPerformance Testing Service

Client.lPush

Modo Foco
Tamanho da Fonte
Última atualização: 2025-03-10 17:15:06
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
}


Ajuda e Suporte

Esta página foi útil?

comentários