Skip to content

Get All Values

Description

This operation retrieves all values from a map.

Method

[[[Backendless.shared hive:(NSString *)hiveName] mapStore:(NSString *)keyName] valuesWithResponseHandler:^(NSArray *)responseHandler errorHandler:^(Fault *)errorHandler];
Backendless.shared.hive(hiveName: String).mapStore(keyName: String).values(responseHandler: (([Any]) -> Void)!, errorHandler: ((Fault) -> Void)!)

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 the map's values. Each individual value can be of any data type.  If the specified map does not contain any key-value pairs, then an empty array is returned.

Example

The example below returns all values from the "employeeNames" map.

[[[Backendless.shared hive:@"company"] mapStore:@"employeeNames"] valuesWithResponseHandler:^(NSArray *response) {
    // handle response
} errorHandler:^(Fault *fault) {
    // handle error
}];
Backendless.shared.hive("company").mapStore("employeeNames").values(responseHandler: { response in
    // handle response
}, errorHandler: { fault in
    // handle error
})

where:

Argument                Description
"company" Name of a hive where the operation is performed.
"employeeNames" Key name identifying a map.

Response Example

[  
    "John Armstrong",  
    "Rebecca Mobley",  
    "Nick Bush"  
]

Codeless Reference

map_api_get_all_values

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 the map's values.

Consider the following Map storage:
map_apI_example_map_store_2

The example below gets all values from the "employeeNames" map:

map_api_example_get_all_values

The logic produces the following output:

map_api_example_get_all_values_2