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¶
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:
The example below retrieves all key-value pairs from the "fruits"
map.
The logic produces the following output: