class Redis
def zunionstore(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 union of `2*zsetA` with `1*zsetB`, summing their scores -
def zunionstore(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([:zunionstore, destination, keys.size] + keys + args) end end