new BulkOperationBase(){OrderedBulkOperation|UnordedBulkOperation}
Create a new OrderedBulkOperation or UnorderedBulkOperation instance (INTERNAL TYPE, do not instantiate directly)
Properties:
| Name | Type | Description |
|---|---|---|
length |
number | Get the number of operations in the bulk. |
Methods
-
bulkExecute(bulk, writeConcern, options, callback)
-
Execute next write command in a chain
Name Type Description bulkclass either OrderedBulkOperation or UnorderdBulkOperation
writeConcernobject optionsobject callbackfunction -
finalOptionsHandler(config, callback)
-
Handles final options before executing command
Name Type Description configobject Name Type Description optionsobject batchnumber resultHandlerfunction callbackfunction -
find(selector)
-
Initiate a find operation for an update/updateOne/remove/removeOne/replaceOne
Name Type Description selectorobject The selector for the bulk operation.
Throws:
-
handleWriteError(callback, writeResult, self)
-
Handles the write error before executing commands
Name Type Description callbackfunction writeResultBulkWriteResult selfclass either OrderedBulkOperation or UnorderdBulkOperation
-
insert(document){OrderedBulkOperation|UnorderedBulkOperation}
-
Add a single insert document to the bulk operation
Name Type Description documentobject the document to insert
Throws:
-
Raw performs the bulk operation
Name Type Description opobject operation