ZINTERSTORE
Computes the intersection of sorted sets given by the specified keys, and stores the result in destination
. It is mandatory to provide the number of input keys (numkeys
) before passing the input keys and the other (optional) arguments.
For a description of the WEIGHTS
and AGGREGATE
options, see ZUNIONSTORE
.
Integer reply: the number of elements in the resulting sorted set at destination
.
(integer) 1
dragonfly> ZADD zset1 2 "two"
(integer) 1
(integer) 1
dragonfly> ZADD zset2 2 "two"
(integer) 1
(integer) 1
dragonfly> ZINTERSTORE out 2 zset1 zset2 WEIGHTS 2 3
(integer) 2
1) "one"
2) "5"
3) "two"