Class: BulkWriteResult

BulkWriteResult

The result of a bulk write.

new BulkWriteResult()

Create a new BulkWriteResult instance

NOTE: Internal Type, do not instantiate directly

Members

deletedCount

Number of documents deleted.

insertedCount

Number of documents inserted.

insertedIds

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

matchedCount

Number of documents matched for update.

modifiedCount

Number of documents modified.

n

The number of inserted documents @type {number}

nInsertednumber

The number of inserted documents

nMatchednumber

Number of matched documents

nModifiednumber

Number of documents updated physically on disk

nRemovednumber

Number of removed documents

nUpsertednumber

Number of upserted documents

okboolean

Evaluates to true if the bulk operation correctly executes

upsertedCount

Number of documents upserted.

upsertedIds

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

Methods

getInsertedIds(){Array.<object>}

Returns an array of all inserted ids

getLastOp(){object}

Retrieve lastOp if available

getRawResponse(){object}

Returns raw internal result

getUpsertedIdAt(index){object}

Returns the upserted id at the given index

Name Type Description
index number

the number of the upserted id to return, returns undefined if no result for passed in index

getUpsertedIds(){Array.<object>}

Returns an array of all upserted ids

getWriteConcernError(){WriteConcernError}

Retrieve the write concern error if any

getWriteErrorAt(index){WriteError}

Returns a specific write error object

Name Type Description
index number

of the write error to return, returns null if there is no result for passed in index

getWriteErrorCount(){number}

Returns the number of write errors off the bulk operation

getWriteErrors(){Array.<WriteError>}

Retrieve all write errors

hasWriteErrors(){boolean}

Returns true if the bulk operation contains a write error

isOk(){boolean}

toJSON(){object}

toString(){string}