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

New $prefix field (parents) not validated during update

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.8.0-rc3
    • Affects Version/s: 2.6.5, 2.8.0-rc0
    • Component/s: Write Ops
    • None
    • Minor Change
    • ALL
    • Hide
      monkey101:(git)mongo[master]/$ ./mongo
      MongoDB shell version: 2.7.8-pre-
      connecting to: test
      > db.version()
      2.7.8-pre-
      > db.scott.drop()
      true
      > db.scott.insert({x:1})
      WriteResult({ "nInserted" : 1 })
      > db.scott.update({x:1},{$rename: {x: "$foo.bar"}})
      WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
      > db.scott.find()
      { "_id" : ObjectId("543c1bb68752a4771eb3d208"), "$foo" : { "bar" : 1 } }
      
      Show
      monkey101:(git)mongo[master]/$ ./mongo MongoDB shell version: 2.7.8-pre- connecting to: test > db.version() 2.7.8-pre- > db.scott.drop() true > db.scott.insert({x:1}) WriteResult({ "nInserted" : 1 }) > db.scott.update({x:1},{$rename: {x: "$foo.bar" }}) WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 }) > db.scott.find() { "_id" : ObjectId( "543c1bb68752a4771eb3d208" ), "$foo" : { "bar" : 1 } }

      {_id: 1} + {$set:{"$bad.good":1}}
      

            Assignee:
            scotthernandez Scott Hernandez (Inactive)
            Reporter:
            dan@mongodb.com Daniel Pasette (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: