Interface CollectionInterface

interface CollectionInterface {
    name: string;
    find(query, queryArgs?): BasePendingCursorOperation;
    findAll(): BasePendingCursorOperation;
    findByID(id): BasePendingIDSpecificOperation;
    upsert(value, options): 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>