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

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

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Minor - P4
    • Resolution: Won't Fix
    • None
    • None
    • Querying
    • None

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: