Module Hub Beta

ZREVPOP

key [WITHSCORE]

Removes and returns the element with the highest score from a Sorted Set.

Return Value

Array reply: an array with the popped element and its score, if WITHSCORE is used.

Examples

redis> ZADD myzset 1 a 2 b 3 c
(integer) 3
redis> ZREVPOP myzset
1) “c”
redis> ZREVPOP myzset WITHSCORE
1) “b”
2) “2”

© 2017 Redis Labs, Inc. All rights reserved.