[JAVA-3369] findOneAndUpdate does not handle an empty update document properly Created: 01/Aug/19  Updated: 28/Oct/23  Resolved: 21/Aug/19

Status: Closed
Project: Java Driver
Component/s: Write Operations
Affects Version/s: None
Fix Version/s: 4.0.0

Type: Bug Priority: Major - P3
Reporter: John Stewart (Inactive) Assignee: John Stewart (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by JAVA-3137 findOneAndUpdate with empty update wi... Closed
Related
is related to JAVA-3137 findOneAndUpdate with empty update wi... Closed
Backwards Compatibility: Minor Change

 Description   

The CRUD specification requires that an update contains at least one
field, in order to check for application bugs. `updateOne` throws an exception when given an empty update document. `findOneAndUpdate` treats the empty update document as a no-op. The empty update document check for `findOneAndUpdate` must be updated in the same manner as the fix for JAVA-3328.



 Comments   
Comment by Githook User [ 15/Jan/20 ]

Author:

{'name': 'John Stewart', 'username': 'jstewart-mongo', 'email': 'john.stewart@mongodb.com'}

Message: Update FieldNameValidator to detect empty update documents

JAVA-3369
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/b7108958f8d290738f0289f54764998d2935a0d8

Comment by John Stewart (Inactive) [ 13/Aug/19 ]

Updating the `FieldNameValidator` interface, as described inĀ JAVA-3137, would be the more elegant solution for this ticket. We will have to wait until 4.0 to resolve this.

Generated at Thu Feb 08 08:59:26 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.