Method: Redis#zcard

Defined in:
lib/redis.rb

#zcard(key) ⇒ Fixnum

Get the number of members in a sorted set.

Examples:

redis.zcard("zset")
  # => 4

Parameters:

  • key (String)

Returns:

  • (Fixnum)


897
898
899
900
901
# File 'lib/redis.rb', line 897

def zcard(key)
  synchronize do
    @client.call [:zcard, key]
  end
end