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

Empty UpdateBuilder<T> will null out a document

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major - P3 Major - P3
    • None
    • 1.9.1
    • None
    • None
    • 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.
      }

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: