MongoDB Documentation, Release 3.0.4 var bulk = db.inventory.initializeUnorderedBulkOp(); The operation returns an unordered operations builder which maintains a list of operations to perform. Unordered operations means that MongoDB can execute in parallel as well as in nondeterministic order. If an error occurs during the processing of one of the write operations, MongoDB will continue to process remaining write operations in the list. You can also initialize an ordered operations builder; see db.collection.initializeOrderedBulkOp() for details. Add two insert operations to the bulk object using the Bulk.insert() method. Step 2: Add insert operations to the bulk object. bulk.insert( { item: "BE10", details: { model: "14Q2", manufacturer: "XYZ Company" }, stock: [ { size: "L", qty: 5 } ], category: "clothing" } ); bulk.insert( { item: "ZYT1", details: { model: "14Q1", manufacturer: "ABC Company" }, stock: [ { size: "S", qty: 5 }, { size: "M", qty: 5 } ], category: "houseware" } ); BulkWriteResult({ "writeErrors" : [ ], "writeConcernErrors" : [ ], "nInserted" : 2, "nUpserted" : 0, "nMatched" : 0, "nModified" : 0, "nRemoved" : 0, "upserted" : [ ] }) Call the execute() method on the bulk object to execute the operations in its list. bulk.execute(); The method returns a BulkWriteResult object with the status of the operation. A successful insert of the docu- ments returns the following object: The nInserted field specifies the number of documents inserted. If the operation encounters an error, the BulkWriteResult object will contain information regarding the error. 95 3.3. MongoDB CRUD Tutorials Step 3: Execute the bulk operation.