The entrypoint for all actions that relate to data stored by Ditto. Provides access to collections, a write transaction API, and a query hash API.

You don't create one directly but can access it from a particular Ditto instance via its store property.

Hierarchy

  • Store

Properties

ditto: Ditto

The Ditto instance this store belongs to.

Methods

  • Returns the collection for the given name. If the collection doesn't exist yet, it will be created automatically as soon as the first entry is inserted.

    Parameters

    • name: string

    Returns Collection

  • Returns the names of all available collections in the store of the related Ditto instance.

    Returns Promise<string[]>

  • Initiate a write transaction in a callback.

    Allows you to group multiple operations together that affect multiple documents, potentially across multiple collections.

    Returns

    a list of WriteTransactionResults. There is a result for each operation performed as part of the write transaction.

    Parameters

    Returns Promise<WriteTransactionResult[]>