class Redis
def zinterstore(destination, keys, options = {})
-
(Fixnum)
- number of elements in the resulting sorted set
Parameters:
-
options
(Hash
) -- -
keys
(Array
) -- source keys -
destination
(String
) -- destination key
Other tags:
- Example: Compute the intersection of `2*zsetA` with `1*zsetB`, summing their scores -
def zinterstore(destination, keys, options = {}) args = [] weights = options[:weights] args.concat ["WEIGHTS", *weights] if weights aggregate = options[:aggregate] args.concat ["AGGREGATE", aggregate] if aggregate synchronize do |client| client.call [:zinterstore, destination, keys.size, *(keys + args)] end end