Get Values¶
Description¶
This operation returns multiple key-value pairs for the specified key names.
Method¶
Backendless.Hive( hiveName ).KeyValueStore.get( keys ): Promise<object>;
where:
Argument | Description |
---|---|
hiveName |
Name of a hive where the operation is performed. String value. |
keys |
An array of key names as strings identifying the key-value pairs. |
Return Value¶
A JSON object containing the specified keys and the corresponding values. In case the specified keys do not exist, the operation returns an empty JSON object.
Example¶
Consider the following key-value store:
The example below retrieves values for the "USA"
and "Japan"
key names:
await Backendless.Hive( 'countries' ).KeyValueStore.get( ['USA', 'Japan'] )
where:
Argument | Description |
---|---|
'countries' |
Name of a hive where the operation is performed. |
['USA', 'Japan'] |
Array containing key names to get the corresponding values for. |
Response¶
{
"USA": "Washington DC",
"Japan": "Tokyo"
}
Codeless Reference¶
where:
Argument | Description |
---|---|
hive name |
Name of a hive where the operation is performed. |
key names |
Key names identifying key-value pairs. |
Returns key-value pairs for the specified keys.
Consider the following Key Value storage:
The example below gets two key-value pairs for the specified keys ("USA"
and "Japan"
):
The output will look as shown below after the Codeless logic runs.