ZDIFFSTORE

Stores a sorted-set difference in a destination.

Sorted sets · Example verified

Syntax covered here

ZDIFFSTORE destination numkeys key

The verified one-input operation reports a destination count equal to the source cardinality.

Tested example & replies

Requests below run in order against an empty database. Each connection authenticates with the fixture password first. Quoted values are strings; null is a nil reply; arrays preserve RESP order.

# connection: default
> ZADD scores 1 a 2 b
2
# connection: default
> ZDIFFSTORE result 1 scores
2