Skip to content

Get Value

Description

This operation retrieves a value associated with the specified key.

Method

Backendless.Hive(hiveName).KeyValueStore(keyName).get(): Promise<value>;

where:

Argument                Description
hiveName Name of a hive where the operation is performed. String value.
keyName Key name identifying a key-value pair. String value.

Return Value

Тhe value associated with the specified key. If the key does not exist, the operation returns null.

Example

The example below retrieves the value associated with the 'Japan' key.

var value = await Backendless.Hive('countries').KeyValueStore('Japan').get()

where:

Argument                Description
'countries' Name of a hive where the operation is performed.
'Japan' Key name to get the value for.

Codeless Reference

keyvalue_api_get_value

where:

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

Returns value for the specified key.

Consider the following Key Value storage:

key-value-store

The example below gets value for the "Japan" key:

keyvalue_api_example_get_value
The output will look as shown below after the Codeless logic runs.
keyvalue_api_example_get_value_2