Class: OrderedBulkOperation

OrderedBulkOperation

new OrderedBulkOperation(){OrderedBulkOperation}

Create a new OrderedBulkOperation instance (INTERNAL TYPE, do not instantiate directly)

Properties:
Name Type Description
length number

Get the number of operations in the bulk.

Returns:
OrderedBulkOperation instance.

Methods

execute(options, callback){Promise}

Execute the ordered bulk operation

Name Type Default Description
options object null optional

Optional settings.

Name Type Default Description
w number | string null optional

The write concern.

wtimeout number null optional

The write concern timeout.

j boolean false optional

Specify a journal write concern.

fsync boolean false optional

Specify a file sync write concern.

callback OrderedBulkOperation~resultCallback optional

The result callback

Throws:
Returns:
Promise if no callback passed

Initiate a find operation for an update/updateOne/remove/removeOne/replaceOne

Name Type Description
selector object

The selector for the bulk operation.

Throws:

Add a single insert document to the bulk operation

Name Type Description
doc object

the document to insert

Throws:

Type Definitions

resultCallback(error, result)

The callback format for results

Name Type Description
error MongoError

An error instance representing the error during the execution.

result BulkWriteResult

The bulk write result.