Skip to content

Get All Keys Names

Description

This operation returns all key names from a map.

Method

Backendless.Hive(hiveName).MapStore(keyName).keys();

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

An array consisting of key names as string values. If the map does not contain any keys, then an empty array is returned.

Example

The example below returns all keys from "fruits" map.

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.

Response Example

[  
    "Oranges",  
    "Apples",  
    "Grapes"  
]

Codeless Reference

map_api_get_all_keys

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:
map_apI_example_map_store

The example below gets all keys from the "fruits" map:

map_api_example_get_all_keys

The logic produces the following output:

get-key-names-response