Get All Keys Names¶
Description¶
This operation returns all key names from a map.
Method¶
Backendless.Hive(hiveName).MapStore(keyName).keys(): Promise<string[]>;
where:
Argument | Description |
---|---|
hiveName |
Name of a hive where the operation is performed. String value. |
keyName |
Key name identifying a map. String value. |
Return Value¶
Аn array of key names as string values. If the map does not contain any keys, then an empty array is returned.
Example¶
The example below retrieves all keys from the 'fruits'
map.
await Backendless.Hive('groceryStore').MapStore('fruits').keys()
where:
Argument | Description |
---|---|
'groceryStore' |
Name of a hive where the operation is performed. |
'fruits' |
Key name identifying a map. |
Return Value Example
[
"Oranges",
"Apples",
"Grapes"
]
Codeless Reference
¶
where:
Argument | Description |
---|---|
hive name |
Name of a hive where the operation is performed. |
key name |
Key name identifying a map. |
Returns a list consisting of key names as string values.
Consider the following Map storage:
The example below gets all keys from the "fruits"
map:
The logic produces the following output: