counters.inc(name, value) Last updated: 07. Oct 2024

API only function

This thread safe function manages a counter identified by a unique name. It increments the counter value and returns the new value. If the counter is not set, it will start with value 1.

Parameters

Name Type Description
name string The unique identifier for the counter.
value integer The value to increment the counter by.

Returns

The incremented counter integer value.

Example

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
let ticketno = counters.inc("Ticketno");
return { "ticketno": ticketno };