Reset Last Operation Time¶
Description¶
The Hive system maintains a timer for every key that measures the number of seconds elapsed since the last operation. This operation resets the timer to zero seconds.
Method¶
// Reset time for one key
[[[Backendless.shared hive:(NSString *)hiveName] storeType:(NSString *)keyName] touchWithResponseHandler:^(void)responseHandler errorHandler:^(Fault *)errorHandler];
// Reset time for multiple keys
[[[Backendless.shared hive:(NSString *)hiveName] storeType] touchWithKeys:(NSArray<NSString *> *)keys responseHandler:^(void)responseHandler errorHandler:^(Fault *)errorHandler];
// Reset time for one key
Backendless.shared.hive(hiveName: String).storeType(keyName: String).touch(responseHandler: (() -> Void)!, errorHandler: ((Fault) -> Void)!)
// Reset time for multiple keys
Backendless.shared.hive(hiveName: String).storeType.touch(keys: [String], responseHandler: (() -> Void)!, errorHandler: ((Fault) -> Void)!)
where:
Argument | Description |
---|---|
hiveName |
Name of a hive where the operation is performed. String value. |
storeType |
This placeholder must be substituted with one of the following stores types: keyValueStore , listStore , mapStore , setStore , sortedSetStore . |
keyName |
Key name to reset last operation time for. String value. |
keys |
An array of key names for which to reset last operation time. Must be an array of string values. |
Return Value¶
The number of reset timers.
Example¶
Reset Time For Multiple Keys
The example below resets time since the last operation of the "fruits"
and "vegetables"
keys to 0
.
[[[Backendless.shared hive:@"groceryStore"] listStore] touchWithKeys:@[@"fruits", @"vegetables"] responseHandler:^{
// handle response
} errorHandler:^(Fault *fault) {
// handle error
}];
Backendless.shared.hive("groceryStore").listStore.touch(keys: ["fruits", "vegetables"], responseHandler: {
// handle response
}, errorHandler: { fault in
// handle error
})
where:
Argument | Description |
---|---|
"groceryStore" |
Name of a hive where the operation is performed. |
["fruits","vegetables"] |
The array of keys in the store to reset time since the last operation. |
Reset Time For One Key
The example below resets time since the last operation of the "fruits"
key to 0
.
[[[Backendless.shared hive:@"groceryStore"] listStore:@"fruits"] touchWithResponseHandler:^{
// handle response
} errorHandler:^(Fault *fault) {
// handle error
}];
Backendless.shared.hive("groceryStore").listStore("fruits").touch(responseHandler: {
// handle response
}, errorHandler: { fault in
// handle error
})
where:
Argument | Description |
---|---|
"groceryStore" |
Name of a hive where the operation is performed. String value. |
"fruits" |
Key name to reset last operation time for. |
Codeless Reference
¶
where:
Argument | Description |
---|---|
hive name |
Name of a hive where the operation is performed. |
type |
Storage type, can be one of the following: Key / Value, Sorted Set, Set, Map, List. |
keys |
A list of key names to reset last operation time for. |
Consider the following Key Value storage:
The example below resets time since the last operation for the specified keys: