Skip to content

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.

Backendless.Cache.contains( key )
 .then( function( result ) {
 })
 .catch( function( error ) {
 });

where:

Argument                Description
key identifies the object to check in cache.

Example

var successCallback = function( response ) {
  console.log( "object exists in cache - " + response );
};

var failureCallback = function( fault ) {
  console.log( "error - " + fault.message );
};

Backendless.Cache.contains( "firstorder" )
 .then( successCallback )
 .catch( failureCallback );