Skip to content

Delete By Key Name

Description

This operation deletes a single or multiple key-value pairs from the map.

Method

DELETE

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]/map/[key]/by-obj-keys

where:

Argument                Description
[hive-name] Name of a hive where the operation is performed.
[key] Key name identifying a map.

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 array containing key names. Each individual key must be of a string type

["Key1", "Key2", ...]

Response Body

The number of key-value pairs deleted from the map. Otherwise, returns 0 if no key-value pairs were deleted.

Example

Delete Multiple Key-Value Pairs

The example below deletes the Apples and Oranges keys and the associated values from the map.

curl --location --request DELETE "https://xxxx.backendless.app/api/hive/groceryStore/map/fruits/by-obj-keys" \--header 'Content-Type: application/json' \--data-raw '["Apples", "Oranges"]'

where:

Argument                Description
groceryStore Name of a hive where the operation is performed.
fruits Key name identifying a map.

Codeless Reference

map_api_delete_keys

where:

Argument                Description
hive name Name of a hive where the operation is performed.
key name Key name identifying a map.
object key names A list of key names identifying key-value pairs.

Returns the number of deleted key-value pairs from the map.

Consider the following Map storage:
map_apI_example_map_store

The example below deletes two key-value pairs "Oranges" and "Apples" from the "fruits" map.

map_api_example_delete_keys

The map will look as shown below after the Codeless logic runs:
map_apI_example_map_store_9