ZDIFFSTORE | SugarDB (original) (raw)
Syntax
ZDIFFSTORE destination key1 key2
Module
sortedset
Categories
slow sortedset write
Description
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")