Class WriteTransactionCollection

Represents a collection of a Ditto store that is used in the context of a write transaction.

Supports most of a regular collection's functionality but cannot be subscribed or live queried and can not be used to create attachments.

Create a WriteTransactionCollection by starting a WriteTransaction and using its scoped method.

Implements

Properties

Methods

Properties

name: string

The name of the collection.

Methods

  • Inserts a new document into the collection and returns its ID.

    If the document already exists, the contents of both are merged by default. You can change this by providing a different writeStrategy via options.

    Parameters

    • value: DocumentValue

      The content of the document to be inserted or updated. Must not contain any non-finite numbers (NaN, Infinity, -Infinity).

    • Optional options: UpsertOptions

      Change defaults for the behavior of the operation, such as the write strategy.

    Returns Promise<DocumentID>