Skip to main content

Method Signature

Parameters

key
string
required
The key of the sorted set
increment
number
required
The amount to increment the score by. Can be negative to decrement the score.
member
TData
required
The member whose score should be incremented. If the member does not exist, it is added to the sorted set with the increment as its score.

Response

result
number
The new score of the member after the increment operation

Examples

Increment a member’s score

Decrement a member’s score

Add new member with increment

Track points over time

Award bonus points

Implement daily streaks

Track negative metrics

Atomic counter with ranking

Implement voting system

Calculate running averages

  • ZADD - Add or update members in a sorted set
  • ZSCORE - Get the score of a member
  • ZRANK - Get the rank of a member
  • ZRANGE - Return a range of members