List
LPUSH
Push an element at the head of the list.
const length1 = await redis.lpush("key", "a", "b", "c");
console.log(length1); // 3
const length2 = await redis.lpush("key", "d");
console.log(length2); // 4
Arguments
key
string
requiredThe key of the list.
elements
...TValue[]
requiredOne or more elements to push at the head of the list.
Response
The length of the list after the push operation.
const length1 = await redis.lpush("key", "a", "b", "c");
console.log(length1); // 3
const length2 = await redis.lpush("key", "d");
console.log(length2); // 4