Method: Redis::Commands::SortedSets#zpopmin
- Defined in:
- lib/redis/commands/sorted_sets.rb
#zpopmin(key, count = nil) ⇒ Array<String, Float>+
Removes and returns up to count members with the lowest scores in the sorted set stored at key.
161 162 163 164 165 166 167 168 |
# File 'lib/redis/commands/sorted_sets.rb', line 161 def zpopmin(key, count = nil) command = [:zpopmin, key] command << Integer(count) if count send_command(command) do |members| members = FloatifyPairs.call(members) count.to_i > 1 ? members : members.first end end |