Method: Redis::Commands::SortedSets#zlexcount

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

#zlexcount(key, min, max) ⇒ Integer

Count the members, with the same score in a sorted set, within the given lexicographical range.

Examples:

Count members matching a

redis.zlexcount("zset", "[a", "[a\xff")
  # => 1

Count members matching a-z

redis.zlexcount("zset", "[a", "[z\xff")
  # => 26

Parameters:

  • key (String)
  • min (String)
    • inclusive minimum is specified by prefixing ‘(`

    • exclusive minimum is specified by prefixing ‘[`

  • max (String)
    • inclusive maximum is specified by prefixing ‘(`

    • exclusive maximum is specified by prefixing ‘[`

Returns:

  • (Integer)

    number of members within the specified lexicographical range



443
444
445
# File 'lib/redis/commands/sorted_sets.rb', line 443

def zlexcount(key, min, max)
  send_command([:zlexcount, key, min, max])
end