ZPOPMAX

Syntax
ZPOPMAX key [count]
Available since:
5.0.0
Time complexity:
O(log(N)*M) with N being the number of elements in the sorted set, and M being the number of elements popped.
ACL categories:
@write, @sortedset, @fast,

移除并返回存储在key的有序集合中得分最高的count个成员。

当未指定时,count的默认值为1。指定一个高于排序集合基数的count值不会产生错误。当返回多个元素时,得分最高的元素将排在第一位,随后是得分较低的元素。

示例

ZADD myzset 1 "one" ZADD myzset 2 "two" ZADD myzset 3 "three" ZPOPMAX myzset

RESP2/RESP3 回复


RATE THIS PAGE
Back to top ↑