Class: BulkWriteResult

BulkWriteResult

The result of a bulk write.

new BulkWriteResult()

Create a new BulkWriteResult instance

NOTE: Internal Type, do not instantiate directly

Members

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

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}