Method: Redis::Commands::SortedSets#zscore

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

#zscore(key, member) ⇒ Float

Get the score associated with the given member in a sorted set.

Examples:

Get the score for member “a”

redis.zscore("zset", "a")
  # => 32.0

Parameters:

  • key (String)
  • member (String)

Returns:

  • (Float)

    score of the member



221
222
223
# File 'lib/redis/commands/sorted_sets.rb', line 221

def zscore(key, member)
  send_command([:zscore, key, member], &Floatify)
end