Skip to content

Clear Key Expiration Time

Description

This operation clears a timeout associated with a key. Note that all keys are created without timeouts by default, and you can set it by invoking the "Set Key Expiration - TTL" or the "Set Key Expiration - Unix time" operations.

Method

[[[Backendless.shared hive:(NSString *)hiveName] storeType:(NSString *)keyName] clearExpirationWithResponseHandler:^(void)responseHandler errorHandler:^(Fault *)errorHandler];
Backendless.shared.hive(hiveName: String).storeType(keyName: String).clearExpiration(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 clear a timeout for. String value.

Return Value

None.

Example

The example below clears the TTL or Unix time timeout set for the "fruits" key.

[[[Backendless.shared hive:@"groceryStore"] listStore:@"fruits"] clearExpirationWithResponseHandler:^{
    // handle response
} errorHandler:^(Fault *fault) {
    // handle error
}];
Backendless.shared.hive("groceryStore").listStore("fruits").clearExpiration(responseHandler: {
    // handle response
}, errorHandler: { fault in
    // handle error
})

where:

Argument                Description
"groceryStore" Name of a hive where the operation is performed.
"fruits" Key name in the store to clear the timeout for.

Codeless Reference

general_api_clear_keys_expiration_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.
key name Key name to clear a timeout for.

Consider the following Key Value storage:

sample-key-value

The example below deletes the timeout set on the "Japan" key.

general_api_example_clear_keys_expiration_time