Method: Redis::Commands::SortedSets#zdiffstore

Defined in:
lib/redis/commands/sorted_sets.rb

#zdiffstore(*args) ⇒ Integer

Compute the difference between the first and all successive input sorted sets and store the resulting sorted set in a new key

Examples:

redis.zadd("zsetA", [[1.0, "v1"], [2.0, "v2"]])
redis.zadd("zsetB", [[3.0, "v2"], [2.0, "v3"]])
redis.zdiffstore("zsetA", "zsetB")
  # => 1

Parameters:

  • destination (String)

    destination key

  • keys (Array<String>)

    source keys

Returns:

  • (Integer)

    number of elements in the resulting sorted set



837
838
839
# File 'lib/redis/commands/sorted_sets.rb', line 837

def zdiffstore(*args)
  _zsets_operation_store(:zdiffstore, *args)
end