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

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Querying
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • 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
            Reporter:
            Cyril Auburtin
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: