Delete Value¶
Description¶
This operation deletes specific values from a list.
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]/delete-value
where:
Argument | Description |
---|---|
[hive-name] |
Name of a hive where the operation is performed. |
[key] |
Key name identifying a list. |
Request Headers¶
Content-Type: application/json
where:
Argument | Description |
---|---|
Content-Type |
Must be set to application/json . This header is mandatory. |
Request Body¶
The request body must be a JSON object with the structure shown below:
{
"value": <any-value>,
"count": <integer-value>
}
where:
Argument | Description |
---|---|
"value" |
Value to delete from the list. Must be a valid JSON value. |
"count" |
Optional parameter. Identifies the number of duplicate items to delete from the list. Defaults to 1. |
Response Body¶
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.
curl --location --request PUT "https://xxxx.backendless.app/api/hive/groceryStore/list/fruits/delete-value" \--header 'Content-Type: application/json' \--data-raw '{"value": "Apple","count": 2}'
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: