The bulk API should raise an exception if find() or insert() is used after execute(). The existing Bulk object will not run those additional operations because execute() can only be run once.
Example run:
> var bulk = db.foo1.initializeUnorderedBulkOp() > bulk.insert({}) > bulk.execute() BulkWriteResult({ "writeErrors" : [ ], "writeConcernErrors" : [ ], "nInserted" : 1, "nUpserted" : 0, "nMatched" : 0, "nModified" : 0, "nRemoved" : 0, "upserted" : [ ] }) > bulk.find({}).removeOne() > bulk.execute() 2014-03-31T18:22:50.694-0400 Error: A bulk operation cannot be re-executed at src/mongo/shell/bulk_api.js:1093
Version: a12d09c9757301c3872cf4b45027d287e3dcc366
- is related to
-
SERVER-12645 bulk insert executability issues
- Backlog