Upstash Documentation

ZADD

Add a member to a sorted set, or update its score if it already exists.
1 min read

Arguments#

keystrrequired#

The key of the sorted set.

scoresDict[str, float]required#

A dictionary of elements and their scores.

xxbool#

Only update elements that already exist. Never add elements.

nxbool#

Only add new elements. Never update elements.

gtbool#

Update scores if the new score is greater than the old score.

ltbool#

Update scores if the new score is less than the old score.

chbool#

Return the number of elements changed instead.

incrbool#

When this option is specified ZADD acts like ZINCRBY. Only one score-element pair can be specified in this mode.

Response#