ZDIFFSTORE
Syntax
ZDIFFSTORE destination key1 key2
Module
sortedsetCategories
slow sortedset writeDescription
Computes the difference between all the sorted sets specifies in the list of keys. Stores the result in destination. If the base set (first key) does not exist, return 0, otherwise, return the cardinality of the diff.
Examples
- Go (Embedded)
- CLI
Store the difference between 2 sorted sets:
db, err := sugardb.NewSugarDB()
if err != nil {
log.Fatal(err)
}
cardinality, err := vault.ZDiffStore("destination", "key1", "key2")
Store the difference between 2 sorted sets:
> ZDIFFSTORE destination key1 key2