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

New $prefix field (parents) not validated during update

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.6.5, 2.8.0-rc0
    • Fix Version/s: 2.8.0-rc3
    • Component/s: Write Ops
    • Labels:
      None
    • Backwards Compatibility:
      Minor Change
    • Operating System:
      ALL
    • Steps To Reproduce:
      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 } }

      Description

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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              scotthernandez Scott Hernandez
              Reporter:
              pasette Daniel Pasette
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: