Skip to main content

ZDIFFSTORE

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

Store the difference between 2 sorted sets:

vault, err := echovault.NewEchoVault()
if err != nil {
log.Fatal(err)
}
cardinality, err := vault.ZDiffStore("destination", "key1", "key2")