[SERVER-13430] Bulk API should prevent additional operations from being added after execute() is run Created: 31/Mar/14  Updated: 10/May/22

Status: Backlog
Project: Core Server
Component/s: Shell
Affects Version/s: 2.6.0-rc2
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Kamran K. Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Unresolved Votes: 0
Labels: 26qa, move-sa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-12645 bulk insert executability issues Backlog
Participants:

 Description   

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



 Comments   
Comment by Steven Vannelli [ 10/May/22 ]

Moving this ticket to the Backlog and removing the "Backlog" fixVersion as per our latest policy for using fixVersions.

Generated at Thu Feb 08 03:31:42 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.