class Redis

def zinterstore(destination, keys, weights: nil, aggregate: nil)

Returns:
  • (Integer) - 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, weights: nil, aggregate: nil)
  args = [:zinterstore, destination, keys.size, *keys]
  if weights
    args << "WEIGHTS"
    args.concat(weights)
  end
  args << "AGGREGATE" << aggregate if aggregate
  synchronize do |client|
    client.call(args)
  end
end