ZPOPMAX

Since 1.1.0Sorted sets

Syntax

ZPOPMAX key [count]
  • Flags: fast, write
  • ACL categories: @fast, @sortedset, @write
  • Arity: -2

Removes and returns the members with the highest scores in the sorted set at key: one, or count.

Reply

  • An array: member, score, member, score, and so on, highest first. Empty if the key does not exist.

Examples

> ZADD p 2 b 3 c 4 d
(integer) 3
> ZPOPMAX p 2
1) "d"
2) "4"
3) "c"
4) "3"