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
值不会产生错误。当返回多个元素时,得分最高的元素将排在第一位,随后是得分较低的元素。
示例
RESP2/RESP3 回复
- Array reply: 弹出的元素和分数的列表。