Method: Redis::Commands::SortedSets#zmscore

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

#zmscore(key, *members) ⇒ Array<Float>

Get the scores associated with the given members in a sorted set.

Examples:

Get the scores for members “a” and “b”

redis.zmscore("zset", "a", "b")
  # => [32.0, 48.0]

Parameters:

  • key (String)
  • members (String, Array<String>)

Returns:

  • (Array<Float>)

    scores of the members



234
235
236
237
238
# File 'lib/redis/commands/sorted_sets.rb', line 234

def zmscore(key, *members)
  send_command([:zmscore, key, *members]) do |reply|
    reply.map(&Floatify)
  end
end