[SERVER-38909] Permit empty update modifiers, treating as a no-op rather than an error Created: 09/Jan/19  Updated: 29/Oct/23  Resolved: 11/Aug/20

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: 4.1.6
Fix Version/s: 4.7.0, 4.0.25, 4.2.15, 4.4.7

Type: Improvement Priority: Major - P3
Reporter: Frank Trampe Assignee: Mindaugas Malinauskas
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Documented
is documented by DOCS-13822 Investigate changes in SERVER-38909: ... Closed
Gantt End to End
Problem/Incident
Related
related to SERVER-48890 allow $addFields with empty document ... Closed
Backwards Compatibility: Minor Change
Backport Requested:
v4.4, v4.2, v4.0
Sprint: Query 2020-08-24
Participants:
Case:
Linked BF Score: 33

 Description   

As a few people have mentioned onĀ SERVER-12266, the change to throw errors on empty updates is highly disruptive and has kept me from updating for a long time. I'm finally in a position in which I need to move to a more recent version of MongoDB and have followed the lead of others in writing an application layer that detects empty patches and aborts the call to MongoDB in those cases. But, in doing so, I'm struck by the absurdity of the application needing to include code for that. Surely it would be much more efficient to implement such functionality within MongoDB, perhaps enabled by a run-time flag? Or perhaps a default, and disabled only via a run-time flag, since I'm sure that the people who want empty patches to work vastly outnumber those who want them to fail. I guess that this could also be a client option.

An action triggered via an option on a patch request to a database-driven service is a very common thing. The success of the operation is seldom desired to be contingent on the presence of patch data, and there are probably millions of lines of code in the world that work around Mongo's inconsistent treatment of empty and non-empty patches. It would be great to be able to remove them.



 Comments   
Comment by Githook User [ 27/May/21 ]

Author:

{'name': 'Mindaugas Malinauskas', 'email': 'mindaugas.malinauskas@mongodb.com'}

Message: SERVER-38909 Permit empty update modifiers, treating as a no-op rather than an error

(cherry picked from commit 96bc79c2fa95e40a917c71b4120257f8dca038d0)
Branch: v4.0
https://github.com/mongodb/mongo/commit/e3cd5569e4fedc7e3c0741712af5293f72c416da

Comment by Githook User [ 26/May/21 ]

Author:

{'name': 'Mindaugas Malinauskas', 'email': 'mindaugas.malinauskas@mongodb.com'}

Message: SERVER-38909 Permit empty update modifiers, treating as a no-op rather than an error

(cherry picked from commit ad51c2da0567585391d9e02529d4a495aa460c4d)
Branch: v4.2
https://github.com/mongodb/mongo/commit/6e29afb9d9b53fd3c6a8187d9af8f77948f69832

Comment by Githook User [ 25/May/21 ]

Author:

{'name': 'Mindaugas Malinauskas', 'email': 'mindaugas.malinauskas@mongodb.com'}

Message: SERVER-38909 Permit empty update modifiers, treating as a no-op rather than an error

(cherry picked from commit c24d2d002b0defbe6a300e0f20cdb9242ec78125)
(cherry picked from commit 2d4e4380f7014861996991f9160921f2b645c8fb)
Branch: v4.4
https://github.com/mongodb/mongo/commit/ad51c2da0567585391d9e02529d4a495aa460c4d

Comment by Githook User [ 19/Aug/20 ]

Author:

{'name': 'Mindaugas Malinauskas', 'email': 'mindaugas.malinauskas@mongodb.com'}

Message: SERVER-38909 Permit empty update modifiers, treating as a no-op rather than an error
Branch: master
https://github.com/mongodb/mongo/commit/2d4e4380f7014861996991f9160921f2b645c8fb

Comment by Githook User [ 11/Aug/20 ]

Author:

{'name': 'Mindaugas Malinauskas', 'email': 'mindaugas.malinauskas@mongodb.com'}

Message: SERVER-38909 Permit empty update modifiers, treating as a no-op rather than an error
Branch: master
https://github.com/mongodb/mongo/commit/c24d2d002b0defbe6a300e0f20cdb9242ec78125

Comment by Githook User [ 10/Aug/20 ]

Author:

{'name': 'Vesselina Ratcheva', 'email': 'vesselina.ratcheva@10gen.com', 'username': 'vessy-mongodb'}

Message: Revert "SERVER-38909 Permit empty update modifiers, treating as a no-op rather than an error"

This reverts commit 957febbf065a51cc278c66c72f5a81ff2630201c.
Branch: master
https://github.com/mongodb/mongo/commit/f7663ec260985506ac482ddb86ceee100e64112d

Comment by Githook User [ 10/Aug/20 ]

Author:

{'name': 'Mindaugas Malinauskas', 'email': 'mindaugas.malinauskas@mongodb.com'}

Message: SERVER-38909 Permit empty update modifiers, treating as a no-op rather than an error
Branch: master
https://github.com/mongodb/mongo/commit/957febbf065a51cc278c66c72f5a81ff2630201c

Comment by Danny Hatcher (Inactive) [ 11/Jan/19 ]

Hello Frank,

Thank you for your report. Our query team will take a look at this ticket and determine the best path forward.

Thank you,

Danny

Generated at Thu Feb 08 04:50:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.