Arguments

key
str
required

The key of the sorted set.

scores
Dict[str, float]
required

A dictionary of elements and their scores.

xx
bool

Only update elements that already exist. Never add elements.

xx
bool

Only add new elements. Never update elements.

gt
bool

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

lt
bool

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

ch
bool

Return the number of elements changed instead.

incr
bool

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

Response

The number of elements added to the sorted sets, not including elements already existing for which the score was updated.

If ch was specified, the number of elements that were updated.

If incr was specified, the new score of member.