Skip to main content

ZINCRBY

Syntax

ZINCRBY key increment member

Module

sortedset

Categories

fast sortedset write

Description

Increments the score of the specified sorted set's member by the increment. If the member does not exist, it is created. If the key does not exist, it is created with new sorted set and the member added with the increment as its score.

Options

  • WITHSCORES - Whether the returned sorted set should include scores

Examples

Increment the score of the sorted set's member:

db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
cardinality, err := vault.ZIncrBy("key", 2.55, "member1")