Class: UnorderedBulkOperation

UnorderedBulkOperation

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

new UnorderedBulkOperation(){UnorderedBulkOperation}

Properties:
Name Type Description
length number

Get the number of operations in the bulk.

Returns:
UnorderedBulkOperation instance.

Extends

Methods

inherited bulkExecute(bulk, writeConcern, options, callback)

Execute next write command in a chain

Name Type Description
bulk class

either OrderedBulkOperation or UnorderdBulkOperation

writeConcern object
options object
callback function

inherited execute(options, callback){Promise}

Execute the ordered bulk operation

Name Type Description
options object optional

Optional settings.

Name Type Default Description
w number | string optional

The write concern.

wtimeout number 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 BulkOperationBase~resultCallback optional

The result callback

Throws:
  • Throws error if the bulk object has already been executed

    Type
    MongoError
  • Throws error if the bulk object does not have any operations

    Type
    MongoError
Returns:
Promise if no callback passed

inherited finalOptionsHandler(config, callback)

Handles final options before executing command

Name Type Description
config object
Name Type Description
options object
batch number
resultHandler function
callback function

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

Name Type Description
selector object

The selector for the bulk operation.

Throws:

inherited handleWriteError(callback, writeResult, self)

Handles the write error before executing commands

Name Type Description
callback function
writeResult BulkWriteResult
self class

either OrderedBulkOperation or UnorderdBulkOperation

Add a single insert document to the bulk operation

Name Type Description
document object

the document to insert

Throws:

Raw performs the bulk operation

Name Type Description
op object

operation