Skip to content

Delete Value(s)

Description

This operation deletes multiple values from a sorted set.

Method

[[[Backendless.shared hive:(NSString *)hiveName] sortedSetStore:(NSString *)keyName] deleteWithValues:(NSArray *)values responseHandler:^(NSInteger)responseHandler errorHandler:^(Fault *)errorHandler];
Backendless.shared.hive(hiveName: String).sortedSetStore(keyName: String).delete(values: [Any], 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.
values An array of values to delete from the specified sorted-set. Each value must be of the same data type as the one stored in the sorted set.

Return Value

A number of deleted values. Returns 0 if the values do not exist in the sorted set.

Example

The example below deletes the specified values( "Dave" and "Frank" ) from the sorted set.

[[[Backendless.shared hive:@"leaderboard"] sortedSetStore:@"players"] deleteWithValues:@[@"Dave", @"Frank"] responseHandler:^(NSInteger response) {
    // handle response
} errorHandler:^(Fault *fault) {
    // handle error
}];
Backendless.shared.hive("leaderboard").sortedSetStore("players").delete(values: ["Dave", "Frank"], 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 for the operation.
"Dave", "Frank" Values to delete.

Codeless Reference
sorted_set_api_delete_values

where:

Argument                Description
hive name Name of a hive where the operation is performed.
key name Key name identifying a sorted set.
values A list of values to delete from the specified sorted set. Each value must be of the same data type and structure as the one stored in the sorted set.

Returns the number of items deleted from the sorted set.

Consider the following Sorted Set storage:
sorted_set_api_example_all_blocks

The example below deletes the following values from the "players" sorted set: "John" and "Bobby".
sorted_set_api_example_delete_values

The sorted set will look as shown below after the Codeless logic runs.
sorted_set_api_example_delete_values_2