Delete First¶
Description¶
This operation deletes values from the beginning of the list and returns them in the response.
Method¶
PUT
Endpoint URL¶
Important
Make sure to replace xxxx in the domain name in the request specification below to the one assigned to your application.
https://xxxx.backendless.app/api/hive/[hive-name]/list/[key]/get-first-and-delete?count=[n-values-to-delete]
where:
Argument | Description |
---|---|
[hive-name] |
Name of a hive where the operation is performed. |
[key] |
Key name identifying a list. |
[n-values-to-delete] |
Optional parameter, defaults to 1 . Sets the number of values to delete from the beginning of the list. |
Request Headers¶
None.
Request Body¶
None.
Response Body¶
An array containing deleted JSON value(s).
Example¶
The example below deletes the first 2
values from the fruits
list.
curl --location --request PUT "https://xxxx.backendless.app/api/hive/shoppingCart/list/fruits/get-first-and-delete?count=2"
where:
Argument | Description |
---|---|
shoppingCart |
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 list: