Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a mutable CRDT counter that can be incremented by a specific amount while updating a document.

This class can't be instantiated directly, it's returned automatically for any counter property within an update block via MutableDocumentPath.counter.

Hierarchy

Index

Constructors

Properties

Methods

Constructors

Properties

value: number

The value of the counter.

Methods

  • increment(amount: number): void
  • Increments the counter by amount, which can be any valid number. Only valid within the closure of Collection's {@link Collection.update | update()} method, otherwise an exception is thrown.

    Parameters

    • amount: number

    Returns void