Skip to content

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.Hive(hiveName).[bucketType](keyName).touch(): Promise<void>;

Reset Time For Multiple Keys

Backendless.Hive(hiveName).[bucketType].touch(keys): Promise<void>;

where:

Argument                Description
hiveName Name of a hive where the operation is performed. String value.
[bucketType] This placeholder must be substituted with one of the following store types: KeyValueStore, ListStore, MapStore, SetStore, SortedSetStore.
keyName Key name to reset last operation time for.
keys An array of key names for which to reset last operation time.

Return Value

None.

Examples


Reset Time For One Key

The example below resets time since the last operation of the 'fruits' key to 0.

await Backendless.Hive('groceryStore').ListStore('fruits').touch()

where:

Argument                Description
'groceryStore' Name of a hive where the operation is performed.
'fruits' Key name to reset time since the last operation for.


Reset Time For Multiple Keys

The example below resets time since the last operation of the 'fruits' and 'vegetables' keys to 0.

await Backendless.Hive('groceryStore').ListStore.touch(['fruits', 'vegetables'])

where:

Argument                Description
'groceryStore' Name of a hive where the operation is performed.
['fruits', 'vegetables'] The array of key names to reset time since the last operation.


Codeless Reference
general_api_reset_last_operation_time

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:

sample-key-value

The example below resets time since the last operation for the specified keys:

general_api_example_reset_last_operation_time