Method: Redis#zscore

Defined in:
lib/redis.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



1137
1138
1139
1140
1141
1142
1143
# File 'lib/redis.rb', line 1137

def zscore(key, member)
  synchronize do
    @client.call [:zscore, key, member] do |reply|
      Float(reply) if reply
    end
  end
end