Skip to main content

ZDIFF

Syntax

ZDIFF key [key...] [WITHSCORES]

Module

sortedset

Categories

read slow sortedset

Description

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

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")