ZDIFF
Syntax
ZDIFF key [key...] [WITHSCORES]
Module
sortedsetCategories
read slow sortedsetDescription
Computes the difference between all the sorted sets specified in the list of keys and returns the result.
Options
WITHSCORES
- Whether the returned sorted set should include scores
Examples
- Go (Embedded)
- CLI
Get the difference between 2 sorted sets:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
sortedSet, err := db.ZDiff(false, "key1", "key2")
Get the difference between 2 sorted sets and include the scores:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
sortedSet, err := vault.ZDiff(true, "key1", "key2")
Get the difference between 2 sorted sets:
> ZDIFF key1 key2
Get the difference between 2 sorted sets and include the scores:
> ZDIFF key1 key2 WITHSCORES