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

v3.6 $setOnInsert may create objects with dots in field names

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 3.6.0
    • Component/s: None
    • Labels:
      None
    • ALL

      v3.6 $setOnInsert may create objects with dots in field names

      v3.4 used to fail in this case because dots are not allowed in field names.
      I did not find anything related in release notes, so it looks like a potential regression.

      The following command adds a document which sub-document has a field "bad.1"

      {{> db.test.update({y : {y :

      {"bad.1" : 1}

      } }, {$setOnInsert :

      {x : 42}

      },

      {upsert : true}

      )
      WriteResult(

      { "nMatched" : 0, "nUpserted" : 1, "nModified" : 0, "_id" : ObjectId("5a2d066a88785e4c179faaa1") }

      )

      > db.test.find()
      { "_id" : ObjectId("5a2d066a88785e4c179faaa1"), "y" : { "y" :

      { "bad.1" : 1 }

      }, "x" : 42 }
      }}

            Assignee:
            Unassigned Unassigned
            Reporter:
            nightroman Roman Kuzmin
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: