Length¶
Description¶
This operation returns the number of items in the sorted set.
Method¶
[[[Backendless.shared hive:(NSString *)hiveName] sortedSetStore:(NSString *)keyName] lengthWithResponseHandler:^(NSInteger)responseHandler errorHandler:^(Fault *)errorHandler];
Backendless.shared.hive(hiveName: String).sortedSetStore(keyName: String).length(responseHandler: ((Int) -> Void)!, errorHandler: ((Fault) -> Void)!)
where:
Argument | Description |
---|---|
hiveName |
Name of a hive where the operation is performed. String value. |
keyName |
Key name identifying a sorted-set. String value. |
Return Value¶
The total number of elements stored in the sorted set.
Example¶
The example below returns the number of items in the sorted set:
[[[Backendless.shared hive:@"leaderboard"] sortedSetStore:@"players"] lengthWithResponseHandler:^(NSInteger response) {
// handle response
} errorHandler:^(Fault *fault) {
// handle error
}];
Backendless.shared.hive("leaderboard").sortedSetStore("players").length(responseHandler: { response in
// handle response
}, errorHandler: { fault in
// handle error
})
where:
Argument | Description |
---|---|
"leaderboard" |
Name of a hive where the operation is performed. |
"players" |
Key name identifying a sorted set. |
Codeless Reference¶
where:
Argument | Description |
---|---|
hive name |
Name of a hive where the operation is performed. |
key name |
Key name identifying a sorted set. |
Returns the total number of elements stored in the requested sorted set.
Consider the following Sorted Set storage:
The example below returns the number of items stored in the "players"
.
The output will look as shown below after the Codeless logic runs.