Skip to content

Get Value By Key Name

Description

This operation returns a value associated with a key.

Method

Backendless.Hive(hiveName).MapStore(keyName).getValue(key): Promise<value>;

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. String value.

Return Value

A  value associated with the specified key. If the key does not exist, then null is returned.

Example

The example below returns the value associated with the 'Oranges'  key from the 'fruitsPrice' map.

await Backendless.Hive('groceryStore').MapStore('fruitsPrice').getValue('Oranges')

where:

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

Response Example

0.99

Codeless Reference

map_api_get_value_by_key_name

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 a value associated with the specified key.

Consider the following Map storage:
map_apI_example_map_store_3

The example below retrieves a value of the key "Oranges" from the "fruitsPrice" map.

map_example_api_get_value_by_key_name

The logic produces the following output:

map_example_api_get_value_by_key_name_2