Sorted Set
ZINCRBY
Increment the score of a member.
await redis.zadd("key", 1, "member");
const value = await redis.zincrby("key", 2, "member");
console.log(value); // 3
Arguments
key
string
requiredThe key of the sorted set.
increment
integer
requiredThe increment to add to the score.
member
TMember
requiredThe member to increment.
Response
The new score of member
after the increment operation.
Was this page helpful?
await redis.zadd("key", 1, "member");
const value = await redis.zincrby("key", 2, "member");
console.log(value); // 3