Interface CollectionInterface

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

  • Search for documents in this collection using the provided query string.

    Parameters

    • query: string

      The query to run against the collection.

    • OptionalqueryArgs: QueryArguments

      These arguments replace placeholders in the provided query.

    Returns BasePendingCursorOperation

    when called in a React Native environment.

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