BZPOPMAX

Removes the highest-score member, waiting up to a timeout if needed.

Sorted sets · Example verified

Syntax covered here

BZPOPMAX key timeout-seconds

A populated set returns its maximum immediately; a missing key returns null after the tested fractional-second timeout.

Tested example & replies

Requests below run in order against an empty database. Each connection authenticates with the fixture password first. Quoted values are strings; null is a nil reply; arrays preserve RESP order.

# connection: default
> ZADD scores 1 a 2 b
2
# connection: default
> BZPOPMAX scores 0.1
["scores","b","2"]
# connection: default
> BZPOPMAX missing-zset 0.1
null