Skip to content

Commit

Permalink
Allow ZREM to remove multiple values
Browse files Browse the repository at this point in the history
  • Loading branch information
jgaskins committed Nov 16, 2023
1 parent 70266be commit cc05b7e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/commands/sorted_set.cr
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ module Redis::Commands::SortedSet
run({"zrem", key, value})
end

def zrem(key : String, *values : String)
run({"zrem", key} + values)
end

def zrem(key : String, values : Enumerable(String))
command = Array(String).new(initial_capacity: 2 + values.size)
command << "zrem" << key
values.each { |value| command << value.as(String) }

run command
end

def zcount(key : String, min : String, max : String)
run({"zcount", key, min, max})
end
Expand Down

0 comments on commit cc05b7e

Please sign in to comment.