ZINCRBY
Syntax
ZINCRBY key increment member
Module
sortedsetCategories
fast sortedset writeDescription
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
- Go (Embedded)
- CLI
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")
Increment the score of the sorted set's member:
> ZINCRBY key 2.55 member1