Skip to content

Get All Key-Values

Description

This operation returns all key-value pairs from a map.

Method

[[[Backendless.shared hive:(NSString *)hiveName] mapStore:(NSString *)keyName] getWithResponseHandler:^(NSDictionary<NSString *,id> *)responseHandler errorHandler:^(Fault *)errorHandler];
Backendless.shared.hive(hiveName: String).mapStore(keyName: String).get(responseHandler: (([String : 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 object containing key-value pairs retrieved from the map.  If no items exist in the map, the returned  object is empty.

Example

The example below returns all key-value pairs from the "shoppingCart" map.

[[[Backendless.shared hive:@"marketplace"] mapStore:@"shoppingCart"] getWithResponseHandler:^(NSDictionary *response) {
    // handle response
} errorHandler:^(Fault *fault) {
    // handle error
}];
Backendless.shared.hive("marketplace").mapStore("shoppingCart").get(responseHandler: { response in
    // handle response
}, errorHandler: { fault in
    // handle error
})

where:

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

Response Example

{  
    "t-shirt": 10.99,  
    "shoes": 45.99  
}

Codeless Reference

codeless-get-key-values

where:

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

Returns an object containing key-value pairs retrieved from the map.

Consider the following Map storage:
map_apI_example_map_store

The example below retrieves all key-value pairs from the "fruits" map.

map_api_example_get_all_key_values

The logic produces the following output:

get-all-keys-values-output