Skip to content

Get Score


This operation returns the score of a value from a sorted set.


[[[Backendless.shared hive:(NSString *)hiveName] sortedSetStore:(NSString *)keyName] getScoreWithValue:(id)value responseHandler:^(double)responseHandler errorHandler:^(Fault *)errorHandler];
Backendless.shared.hive(hiveName: String).sortedSetStore(keyName: String).getScore(value: Any, responseHandler: ((Double) -> Void)!, errorHandler: ((Fault) -> Void)!)


Argument                Description
hiveName Name of a hive where the operation is performed. String value.
keyName Key name identifying a sorted-set. String value.
value The value identifying a score-value pair.

Return Value

The score of the specified item. Otherwise, returns null if the specified key or the value in the sorted set does not exist.


The example below returns the score of the "JoeTheGamer" item from the  sorted set.

[[[Backendless.shared hive:@"leaderboard"] sortedSetStore:@"players"] getScoreWithValue:@"JoeTheGamer" responseHandler:^(double response) {
    // handle response
} errorHandler:^(Fault *fault {
    // handle error
Backendless.shared.hive("leaderboard").sortedSetStore("players").getScore(value: "JoeTheGamer", responseHandler: { response in
    // handle error
}, errorHandler: { fault in
    // handle response


Argument                Description
"leaderboard" Name of a hive in the system.
"players" Name of a sorted set where the operation takes place.
"JoeTheGamer" Value to get the score of.

Codeless Reference



Argument                Description
hive name Name of a hive where the operation is performed.
key name Key name identifying a sorted set.
value Value to get the score of.

Returns the score of an item. Returns null if the value does not exist in the sorted set.

Consider the following Sorted Set storage:

The example below retrieves the score of a value "Julia" from the "players" sorted set:

The output will look as shown below after the Codeless logic runs: