increment

fun increment(    step: Number,     startValue: Number = 0,     callback: WebcomResultCallback<Number>? = null)

Atomically increments the value at this data node by a given step.

"Atomically" means that this operation may be concurrently run by several clients in a safe way (typically, none of the concurrent increment operations will overwrite any other one). Under the hood, this operation is implemented in a more efficient way than the runTransaction method and should be preferred each time the intended transaction consists in an increment operation.

If the current data node has no value, then the increment behaves as if it was startValue. If the current data node has a non-numeric value, then the operation fails with an error.

The given callback receives the resulting value of the data node after the increment operation. Note that in case of concurrent operations, this value may differ from the actual one after all operations. It is better to use a subscription to watch the value of a data node in real time.