ZPOPMIN

Since 1.1.0Sorted sets

Syntax

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

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

Reply

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

Examples

> ZADD p 1 a 2 b 3 c
(integer) 3
> ZPOPMIN p
1) "a"
2) "1"