Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1020

Empty UpdateBuilder<T> will null out a document

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 1.9.1
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows 8.1

      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.
      }
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            zhyk zhyk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: