Class BulkWriteResult

The result of a bulk write.

Properties

deletedCount: number

Number of documents deleted.

insertedCount: number

Number of documents inserted.

insertedIds: {
    [key: number]: any;
}

Inserted document generated Id's, hash key is the index of the originating operation

matchedCount: number

Number of documents matched for update.

modifiedCount: number

Number of documents modified.

upsertedCount: number

Number of documents upserted.

upsertedIds: {
    [key: number]: any;
}

Upserted document generated Id's, hash key is the index of the originating operation

Accessors

  • get ok(): number
  • Evaluates to true if the bulk operation correctly executes

    Returns number

Methods

  • Returns raw internal result

    Returns Document

  • Returns the upserted id at the given index

    Parameters

    • index: number

    Returns undefined | Document

  • Retrieve the write concern error if one exists

    Returns undefined | WriteConcernError

  • Returns a specific write error object

    Parameters

    • index: number

    Returns undefined | WriteError

  • Returns the number of write errors from the bulk operation

    Returns number

  • Retrieve all write errors

    Returns WriteError[]

  • Returns true if the bulk operation contains a write error

    Returns boolean

  • Returns boolean

  • Returns string