Delete First¶
Description¶
This operation deletes values from the beginning of the list and returns them in the response.
Method¶
[[[Backendless.shared hive:(NSString *)hiveName] listStore:(NSString *)keyName] deleteFirstWithCount:(NSInteger)count responseHandler:^(NSArray *)responseHandler errorHandler:^(Fault *)errorHandler];
Backendless.shared.hive(hiveName: String).listStore(keyName: String).deleteFirst(count: Int, responseHandler: (([Any]) -> 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. |
count |
Optional parameter. Identifies the number of items to delete from the list. Defaults to 1. |
Return Value¶
An array containing deleted value(s).
Example¶
The example below deletes the first 2
values from the "fruits"
list.
[[[Backendless.shared hive:@"groceryStore"] listStore:@"fruits"] deleteFirstWithCount:2 responseHandler:^(NSArray *response) {
// handle response
} errorHandler:^(Fault *fault) {
// handle error
}];
Backendless.shared.hive("groceryStore").listStore("fruits").deleteFirst(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. |
Codeless Reference¶
where:
Argument | Description |
---|---|
hive name |
Name of a hive where the operation is performed. |
key name |
Key name identifying a list. |
position: first |
Instructs Hive to delete the first value from the beginning of the list. |
count |
Specifies the number of items to delete. |
Returns a list of the deleted values.
Consider the following List storage:
The example below deletes the first value from the beginning of the "fruits"
list:
The list will look as shown below after the Codeless logic runs: