Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-26961

$unset by setting to undefined (like JSON.stringify does)

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • Labels:
      None

      I think it would be interesting if

      db.foo.updateOne({i:1}, {$set:{foo:7, bar:undefined}})
      

      does the same than:

      db.foo.updateOne({i:1}, {$set:{foo:7}, $unset:{bar:undefined}})
      

      db.foo.updateOne({i:1}, {$set:{foo:7, bar:undefined}}) would be similar to JSON.stringify({foo:7, bar:undefined}) that have only the foo field

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            caub Cyril Auburtin
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: