Skip to content

Check If Exists

Description

This operation verifies if a specific key exists in the specified map.

Method

GET

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]/exists/[key-name]

where:

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

Request Headers

None.

Request Body

None.

Response Body

true if an object exists. Otherwise, returns false.

Example

The example below checks if the Oranges key exists in the fruits map.

curl --location --request GET "https://xxxx.backendless.app/api/hive/groceryStore/map/fruits/exists/Oranges"

where:

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

Codeless Reference
map_api_check_if_key_exists

where:

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

Returns true if an object exists. Otherwise, returns false.

Consider the following Map storage:
map_apI_example_map_store

The example below checks if a key-value pair with the key name "Oranges" exists in the "fruits" map.

map_api_example_check_if_key_exists

The logic produces the following output:

map_api_example_check_if_key_exists_2