Method: Redis::Commands::SortedSets#zpopmax
- Defined in:
- lib/redis/commands/sorted_sets.rb
#zpopmax(key, count = nil) ⇒ Array<String, Float>+
Removes and returns up to count members with the highest scores in the sorted set stored at key.
138 139 140 141 142 143 144 145 |
# File 'lib/redis/commands/sorted_sets.rb', line 138 def zpopmax(key, count = nil) command = [:zpopmax, key] command << Integer(count) if count send_command(command) do |members| members = FloatifyPairs.call(members) count.to_i > 1 ? members : members.first end end |