[SERVER-48780] bulkWrite() in mongo shell does not check updates start with '$' and replacements do not Created: 15/Jun/20  Updated: 19/Jun/23  Resolved: 19/Jun/23

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Max Hirschhorn Assignee: [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive)
Resolution: Won't Do Votes: 0
Labels: move-stm, sdp-backlog-purge
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-13092 shell bulk API replaceOne behaves lik... Closed
is related to SERVER-17953 Implement Driver CRUD API Spec in shell Closed
is related to SERVER-28383 Shell bulk.updateOne allows replacement Closed
Assigned Teams:
Server Development Platform
Operating System: ALL
Steps To Reproduce:

The following should all throw a JavaScript exception without executing the command on the server:

db.mycoll.bulkWrite([{replaceOne: {filter: {}, replacement: {$set: {a: 1}}}}])
db.mycoll.bulkWrite([{updateOne: {filter: {}, update: {field: 1}}}])
db.mycoll.bulkWrite([{updateMany: {filter: {}, update: {field: 1}}}])

Participants:

 Description   

DBCollection.prototype.replaceOne() validates the replacement document contains at least one non-$operator field. DBCollection.prototype.updateOne() and DBCollection.prototype.updateMany() validate the update object contains at least one $operator field.

However, none of replaceOne, updateOne, or updateMany in DBCollection.prototype.bulkWrite() do the same.



 Comments   
Comment by Alex Neben [ 19/Jun/23 ]

This has been identified as work that the SDP team won't do in the near term. Please reopen with a comment if you feel this work should be reprioritized and explain why.

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 05:18:03 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.