List
LREM
Remove the first count
occurences of an element from a list.
await redis.lpush("key", "a", "a", "b", "b", "c");
const removed = await redis.lrem("key", 4, "b");
console.log(removed) // 2
Arguments
key
string
requiredThe key of the list.
count
number
requiredHow many occurrences of the element to remove.
element
TValue
requiredThe element to remove
Response
The number of elements removed.
await redis.lpush("key", "a", "a", "b", "b", "c");
const removed = await redis.lrem("key", 4, "b");
console.log(removed) // 2