Method: Redis#zremrangebyscore

Defined in:
lib/redis.rb

#zremrangebyscore(key, min, max) ⇒ Fixnum

Remove all members in a sorted set within the given scores.

Examples:

Remove members with score >= 5 and < 100

redis.zremrangebyscore("zset", "5", "(100")
  # => 2

Remove members with scores > 5

redis.zremrangebyscore("zset", "(5", "+inf")
  # => 2

Parameters:

  • key (String)
  • min (String)
    • inclusive minimum score is specified verbatim
    • exclusive minimum score is specified by prefixing (
  • max (String)
    • inclusive maximum score is specified verbatim
    • exclusive maximum score is specified by prefixing (

Returns:

  • (Fixnum)

    number of members that were removed



1103
1104
1105
1106
1107
# File 'lib/redis.rb', line 1103

def zremrangebyscore(key, min, max)
  synchronize do
    @client.call [:zremrangebyscore, key, min, max]
  end
end