await redis.lpush("key", "a", "b", "c"); 
const length = await redis.lpushx("key", "d"); 
console.log(length); // 4

Arguments

key
string
required
The key of the list.
elements
...TValue[]
required
One or more elements to push at the head of the list.

Response

The length of the list after the push operation.0 if the list did not exist and thus no element was pushed.
await redis.lpush("key", "a", "b", "c"); 
const length = await redis.lpushx("key", "d"); 
console.log(length); // 4