Get Value¶
Description¶
This operation retrieves a value associated with the specified key.
Method¶
[[[Backendless.shared hive:(NSString *)hiveName] keyValueStore:(NSString *)keyName] getWithResponseHandler:^(id)responseHandler errorHandler:^(Fault *)errorHandler];
Backendless.shared.hive(hiveName: String).keyValueStore(keyName: String).get(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 key-value pair. String value. |
Return Value¶
Тhe value associated with the specified key. If the key does not exist, the operation returns null
.
Example¶
The example below retrieves the value associated with the "Japan"
key.
[[[Backendless.shared hive:@"countries"] keyValueStore:@"Japan"] getWithResponseHandler:^(id response) {
// handle response
} errorHandler:^(Fault *fault) {
// handle error
}];
Backendless.shared.hive("countries").keyValueStore("Japan").get(responseHandler: { response in
// handle response
}, errorHandler: { fault in
// handle error
})
where:
Argument | Description |
---|---|
"countries" |
Name of a hive where the operation is performed. |
"Japan" |
Key name to get the value for. |
Codeless Reference¶
where:
Argument | Description |
---|---|
hive name |
Name of a hive where the operation is performed. |
key name |
Key name identifying a key-value pair. |
Returns value for the specified key.
Consider the following Key Value storage:
The example below gets value for the "Japan"
key:
The output will look as shown below after the Codeless logic runs.