Interface CollectionInterface

Interface for a collection in a Ditto store.

Use DQL (Ditto Query Language) instead. For more information see: https://ditto.com/link/dql-legacy-to-dql-adoption

interface CollectionInterface {
    name: string;
    find(query: string, queryArgs?: QueryArguments): BasePendingCursorOperation;
    findAll(): BasePendingCursorOperation;
    findByID(id: any): BasePendingIDSpecificOperation;
    upsert(value: DocumentValue, options: UpsertOptions): Promise<DocumentID>;
}

Implemented by

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).

    • options: UpsertOptions

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

    Returns Promise<DocumentID>

    when called in a React Native environment.

    Use DQL (Ditto Query Language) instead. For more information see: https://ditto.com/link/dql-legacy-to-dql-adoption