[CSHARP-1020] Empty UpdateBuilder<T> will null out a document Created: 25/Jul/14  Updated: 04/Apr/15  Resolved: 04/Apr/15

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.9.1
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: zhyk Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Windows 8.1



 Description   

See also: [Empty UpdateBuilder will null out a document:https://jira.mongodb.org/browse/CSHARP-282]

MongoCollection<T>.Update() should also throw an exception for an empty QueryBuilder<T>.

void EmptyUpdate(MongoCollection<T> c)
{
    c.Update(Query.Null, new UpdateBuilder<T>());  // This will empty the document silently.
    c.Update(Query.Null, new UpdateBuilder());  // This will throw an exception.
}



 Comments   
Comment by Craig Wilson [ 04/Apr/15 ]

We have a new API in 2.0 and won't be fixing this in 1.10.

Generated at Wed Feb 07 21:38:27 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.