Skip to content

Time Since Last Operation

Description

The Hive system maintains a timer for every key that measures the number of seconds elapsed since the last operation. This operation returns the time calculated by the timer as a number of seconds elapsed since the last operation performed on the specified key.

Method

GET

Endpoint URL

Important

Make sure to replace xxxx in the domain name in the request specification below to the one assigned to your application.

https://xxxx.backendless.app/api/hive/[hive-name]/[bucket-type]/[key]/seconds-since-last-operation

where:

Argument                Description
[hive-name] Name of a hive where the operation is performed.
[bucket-type] Storage type in the[hive-name] Hive where the time since last operation will be retrieved for a key. Acceptable values are list, key-value, map, set or sorted-set.
[key] Key name to get the time since last operation for.

Request Headers

None.

Request Body

None.

Response Body

The number of seconds elapsed since the last operation.

null if the specified key does not exist.

Example

The example below retrieves the number of seconds elapsed since the last operation performed on the fruits key.

curl --location --request GET "https://xxxx.backendless.app/api/hive/groceryStore/list/fruits/seconds-since-last-operation"

where:

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

Codeless Reference

general_api_time_since_last_operation

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.
key name Key name to get the time since last operation for.

Returns the number of seconds since the last operation. null if the specified key does not exist.

Consider the following Key Value storage:

sample-key-value

The example below gets the time since the last operation for the "Japan" key:

general_api_example_time_since_last_operation

The output will look as shown below after the Codeless logic runs.

general_api_example_time_since_last_operation_2