Sorted Set

ZPOPMAX

Removes and returns up to count members with the highest scores in the sorted set stored at key.

Arguments

keybodystrrequired

The key of the sorted set

countbodyint

The number of members to pop

Response

List[Tuple[str, float]]

A list of tuples containing the popped members and their scores

Example
redis.zadd("myset", {"a": 1, "b": 2, "c": 3})assert redis.zpopmax("myset") == [("c", 3)]
Loading search…