Reset counter¶
Resets the current counter value to zero.
// *******************************************
// Backendless.Counters approach
// *******************************************
Backendless.Counters.reset( counterName )
.then( function( result ) {
})
.catch( function( error ) {
});
// *******************************************
// Backendless.Counters.of() approach
// *******************************************
var counter = Backendless.Counters.of( counterName );
counter.reset()
.then( function( result ) {
})
.catch( function( error ) {
});
where:
Argument | Description |
---|---|
counterName |
name of the counter to reset. |
Example¶
var successCallback = function( response ) {
console.log( "counter has been reset" );
};
var failureCallback = function( fault ) {
console.log( "error - " + fault.message );
};
// ************************************************
// Backendless.Counters approach
// ************************************************
Backendless.Counters.reset( "my counter" )
.then( successCallback )
.catch( failureCallback );
// ************************************************
// Backendless.Counters.of() approach
// ************************************************
var myCounter = Backendless.Counters.of( "my counter" );
myCounter.reset()
.then( successCallback )
.catch( failureCallback );
Codeless Reference¶
where:
Argument | Description |
---|---|
counter name |
Name of the counter whose value must be set to 0. |
This operation does not return a value.
Consider the following counter:
The example below resets the value of the "CarsParkingLot"
counter 0
.
The result of this operation will look as shown below after the Codeless logic runs: