Skip to content

Delete Key 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 "Bob" from the blockList list.

curl --location --request PUT "https://xxxx.backendless.app/api/hive/contacts/list/blockList/delete-value" \--header 'Content-Type: application/json' \--data-raw '{"value": "Bob","count": 2}'

where:

Argument                Description
contacts Name of a hive where the operation is performed.
blockList Key name identifying a list.

Codeless Reference
list_api_delete_key_value

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:

list_api_example_get_values_2

The example below deletes one item "value2" from the list.
list_api_example_delete_key_value