Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface CrdtCounter

A counter is a object that stores a single integer and can be incremented or decremented.

Example:

let counter = connection.counter("myCounter")
await connection.update(
    counter.increment(3)
);
let val = await counter.read();

Hierarchy

Implemented by

Index

Properties

Methods

Properties

parent

parent: CrdtFactory

the parent factory

Methods

increment

  • increment(amount: number | Long): ApbUpdateOp
  • Creates an operation to increment the counter. Negative numbers will decrement the value. Use Connection.update to send the update to the database.

    Parameters

    • amount: number | Long

    Returns ApbUpdateOp

read

  • read(): Promise<number>

Generated using TypeDoc