BZPOPMIN

Since 1.1.0Sorted sets

Syntax

BZPOPMIN key [key ...] timeout
  • Flags: blocking, write
  • ACL categories: @blocking, @slow, @sortedset, @write
  • Arity: -3

ZPOPMIN of one member from the first non-empty sorted set of those given. If all are empty, waits until another client adds to one, or until timeout seconds have passed; 0 waits for ever. Clients waiting on one key are served in the order they started waiting.

Reply

  • An array of the key, the member and its score.
  • nil if the timeout passed.

Examples

> ZADD bz 1 x
(integer) 1
> BZPOPMIN bz0 bz 1
1) "bz"
2) "x"
3) "1"