Check If Exists¶
Description¶
This operation verifies if a specific key exists in the specified map.
Method¶
Backendless.Hive(hiveName).MapStore(keyName).keyExists(key): Promise<boolean>;
where:
Argument | Description |
---|---|
hiveName |
Name of a hive where the operation is performed. String value. |
keyName |
Key name identifying a map. String value. |
key |
Key name identifying a key-value pair to check if it exists. String value. |
Return Value¶
true
if an object exists. Otherwise, returns false
.
Example¶
The example below checks if the 'Oranges'
key exists in the 'fruits'
map.
await Backendless.Hive('groceryStore').MapStore('fruits').keyExists('Oranges')
where:
Argument | Description |
---|---|
'groceryStore' |
Name of a hive where the operation is performed. |
'fruits' |
Key name identifying a map. |
Codeless Reference
¶
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:
The example below checks if a key-value pair with the key name "Oranges"
exists in the "fruits"
map.
The logic produces the following output: