Class BulkWriteResult<Schema>

Represents the result of a bulk write operation.

Type Parameters

Constructors

  • Internal

    Should not be instantiated directly.

    Type Parameters

    Parameters

    • deletedCount: number = 0

      The number of documents deleted.

    • insertedCount: number = 0

      The number of documents inserted.

    • matchedCount: number = 0

      The number of documents matched by an update operation.

    • modifiedCount: number = 0

      The number of documents modified.

    • upsertedCount: number = 0

      The number of documents upserted.

    • upsertedIds: Record<number, IdOf<Schema>> = {}

      Upserted document generated ids. Sparse array, indexed by the position of the upserted operation in the bulk write request.

    • _raw: object[] = []

    Returns BulkWriteResult<Schema>

Properties

_raw: object[] = []
deletedCount: number = 0

The number of documents deleted.

insertedCount: number = 0

The number of documents inserted.

matchedCount: number = 0

The number of documents matched by an update operation.

modifiedCount: number = 0

The number of documents modified.

upsertedCount: number = 0

The number of documents upserted.

upsertedIds: Record<number, IdOf<Schema>> = {}

Upserted document generated ids. Sparse array, indexed by the position of the upserted operation in the bulk write request.

Methods

  • Returns the upserted id at the given index.

    Parameters

    • index: number

      The index of the upserted id to retrieve.

    Returns undefined | IdOf<Schema>

    The upserted id at the given index, or undefined if there is no upserted id at that index.