Delete Keys¶
Description¶
This operation deletes multiple keys and the corresponding values from a Hive store.
Method¶
[[[Backendless.shared hive:(NSString *)hiveName] storeType] deleteWithKeys:(NSArray<NSString *> *)keys responseHandler:^(NSInteger)responseHandler errorHandler:^(Fault *)errorHandler];
Backendless.shared.hive(hiveName: String).storeType.delete(keys: [String], responseHandler: ((Int) -> Void)!, errorHandler: ((Fault) -> Void)!)
where:
Argument | Description |
---|---|
hiveName |
Name of a hive where the operation is performed. String value. |
storeType |
This placeholder must be substituted with one of the following stores types: keyValueStore , listStore , mapStore , setStore , sortedSetStore . |
keys |
Represents an array of keys that must be deleted from the specified store. Array of string values. |
Return Value¶
The number of deleted keys. If no keys are deleted, then 0
is returned.
Example¶
The example below deletes the "fruits"
and "vegetables"
keys from the key-value store.
[[[Backendless.shared hive:@"groceryStore"] keyValueStore] deleteWithKeys:@[@"fruits", @"vegetables"] responseHandler:^(NSInteger response) {
// handle response
} errorHandler:^(Fault *fault) {
// handle error
}];
Backendless.shared.hive("groceryStore").keyValueStore.delete(keys: ["fruits", "vegetables"], responseHandler: { response in
// handle response
}, errorHandler: { fault in
// handle error
})
where:
Argument | Description |
---|---|
"groceryStore" |
Name of a hive where the operation is performed. |
["fruits","vegetables"] |
The array of keys to delete from the store. |
Codeless Reference¶
where:
Argument | Description |
---|---|
hive name |
Name of a hive where the operation is performed. |
type |
Storage type, can be one of the following: Key / Value, Sorted Set, Set, Map, List. |
keys |
An array of key names (as string values) to delete. |
Returns the number of deleted keys. If no keys are deleted, then 0
is returned.
Consider the following Key Value storage:
The example below deletes two key-value pairs from the Key Value storage.
The key-value storage will look as shown below after the Codeless logic runs: