Checking if key exists in cache¶
This API request checks if an object exists in cache. If object is present in cache, the method returns true, otherwise - false. All methods are available via Backendless.Cache.[methodname]
accessor:
Future<bool> Backendless.cache.contains(String key);
where:
Argument | Description |
---|---|
key |
identifies the object to check in cache. |
Example¶
Backendless.cache.contains("firstorder").then((result) {
print("Object exists in cache - $result");
});
Codeless Reference¶
where:
Argument | Description |
---|---|
key name |
Key assigned to the object to identify it in cache. The key is used to check if the cache still contains the object. |
Returns true
if the key still exists in cache, otherwise returns false
.
Consider the following key-value pair stored in cache:
The example below checks if the key "orderName"
is still stored in cache.
The operation returns true
, indicating that the "orderName"
key still exists in cache.