FindOneAndUpdateAsync with empty update definition erases document fields

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.2.4
    • Affects Version/s: 2.0
    • Component/s: Operations
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      When calling FindOneAndUpdateOptions with update definition which is combination of items of update definitions list if the list is empty, then all document fields, except for id gets erased.

      Unable to find source-code formatter for language: cs. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      var updates = new List<UpdateDefinition<Region>>();
      _collection.FindOneAndUpdateAsync(filter, Builders<Region>.Update.Combine(updates), new FindOneAndUpdateOptions<Region>
                      {
                          ReturnDocument = ReturnDocument.After,
                      });
      

              Assignee:
              Craig Wilson
              Reporter:
              Nick Abalov [X]
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: