List

LREM

Remove the first `count` occurrences of an element from a list.

Arguments

keybodystringrequired

The key of the list.

countbodynumberrequired

How many occurrences of the element to remove.

elementbodyTValuerequired

The element to remove

Response

integerrequired

The number of elements removed.

Example
await redis.lpush("key", "a", "a", "b", "b", "c"); const removed = await redis.lrem("key", 4, "b"); console.log(removed) // 2
Loading search…