Delete Values With Max Score¶
This operation retrieves and deletes items with the highest scores from the sorted set. You can specify the number of values to retrieve and delete.
Backendless.Hive( hiveName ).SortedSetStore( keyName ).getAndDeleteMaxScore( count ): Promise<items>;
||Name of a hive in the system where the operation is performed. Must be a string.|
||Key name of a sorted set where score-values with the highest scores are retrieved and deleted from.|
||Optional parameter, if not present, defaults to 1. Number of values to delete from the sorted set.|
An array of the deleted score-value pairs. Each element in the array is an array of two elements: score and the corresponding value.
The example below deletes five items with the highest scores from the
'leaderboard' sorted set.
||Name of a hive in the system.|
||Key name of a sorted set where to retrieve and delete items from.|
||Name of a hive where the operation is performed.|
||Key name identifying a sorted set.|
||Specify the number of values to delete from the sorted set.|
Returns a list of the deleted score-value pairs.
Consider the following Sorted Set storage:
The example below deletes one value with the maximum score from the
"players" sorted set. Considering the sorted set presented above, the value
"Julia" is deleted since it has the highest score.
The sorted set will look as shown below after the Codeless logic runs.