Opensearch dashboards.savedobjectsrepository.incrementcounter
Home > opensearch-dashboards > SavedObjectsRepository > incrementCounter
SavedObjectsRepository.incrementCounter() method
Increases a counter field by one. Creates the document if one doesn't exist for the given id.
Signature:
incrementCounter(type: string, id: string, counterFieldName: string, options?: SavedObjectsIncrementCounterOptions): Promise<SavedObject>;
Parameters
| Parameter | Type | Description |
|---|---|---|
| type | string | |
| id | string | |
| counterFieldName | string | |
| options | SavedObjectsIncrementCounterOptions | {object} [options.migrationVersion=undefined] |
Returns:
Promise<SavedObject>
{promise}