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 bulkclass either OrderedBulkOperation or UnorderdBulkOperation
writeConcernobject optionsobject callbackfunction -
inherited execute(options, callback){Promise}
-
Execute the ordered bulk operation
Name Type Description optionsobject optional Optional settings.
Name Type Default Description wnumber | string optional The write concern.
wtimeoutnumber optional The write concern timeout.
jboolean false optional Specify a journal write concern.
fsyncboolean false optional Specify a file sync write concern.
callbackBulkOperationBase~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 configobject Name Type Description optionsobject batchnumber resultHandlerfunction callbackfunction -
inherited find(selector)
-
Initiate a find operation for an update/updateOne/remove/removeOne/replaceOne
Name Type Description selectorobject The selector for the bulk operation.
Throws:
-
inherited handleWriteError(callback, writeResult, self)
-
Handles the write error before executing commands
Name Type Description callbackfunction writeResultBulkWriteResult selfclass either OrderedBulkOperation or UnorderdBulkOperation
-
inherited 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