Delete Value¶
Description¶
This operation deletes specific values from a list.
Method¶
[[[Backendless.shared hive:(NSString *)hiveName] listStore:(NSString *)keyName] deleteWithValue:(id)value count:(NSInteger)count responseHandler:^(NSInteger)responseHandler errorHandler:^(Fault *)errorHandler];
Backendless.shared.hive(hiveName: String).listStore(keyName: String).delete(value: Any, count: Int, 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 list. String value. |
value |
Value to delete from the list. Can be of any data type. |
count |
Optional parameter. Identifies the number of duplicate items to delete from the list. Defaults to 1. |
Return Value¶
The number of deleted values. 0
if the specified key cannot be not found.
Example¶
The example below deletes 2
identical values of "Apple"
from the "fruits"
list.
[[[Backendless.shared hive:@"groceryStore"] listStore:@"fruits"] deleteWithValue:"Apple" count:2 responseHandler:^(NSInteger response) {
// handle response
} errorHandler:^(Fault *fault) {
// handle error
}];
Backendless.shared.hive("groceryStore").listStore("fruits").delete(value: "Apple", count: 2, responseHandler: { response in
// handle response
}, errorHandler: { fault in
// handle error
})
where:
Argument | Description |
---|---|
"groceryStore" |
Name of a hive where the operation is performed. |
"fruits" |
Key name identifying a list. |
"Apple" |
Value to delete from the list. |
Codeless Reference¶
where:
Argument | Description |
---|---|
hive name |
Name of a hive where the operation is performed. |
key name |
Key name identifying a list. |
value |
Value that must be deleted from the list. |
count |
Specify the number of duplicate items to delete. |
The number of deleted items.
Consider the following List storage:
The example below deletes 2
identical values "Apple"
from the "fruits"
list, since the count
parameter is set to 2
.
The list will look as shown below after the Codeless logic runs: