Function replace

  • Insert or replace a value in a collection.

    This operation differs from [[insert]] in that it does not check for the existence of a document with the same _id value - it will replace whatever is there.

    Type Parameters

    Parameters

    • context: Context

      the context

    • collectionName: string

      the collection to update

    • value: Record<string, unknown>

      the document to insert or replace

    • options: {
          condition?: CompositeCondition;
      } = {}

      options to apply

      • Optional condition?: CompositeCondition

        an optional conditional expression that must be satifisfied for the update to proceed

    Returns Promise<DocumentType>

    the inserted / replaced value

    Throws

    when the collection is not found

Generated using TypeDoc