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

renameCollection allows renaming to system collections

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 2.6.0-rc0
    • None
    • Admin
    • None
    • Minor Change
    • ALL

    Description

      This bypasses the error when users try to insert into system namespaces:

      > db.system.foo.insert({})
      2014-02-03T16:09:53.434-0500 batch failed, cannot aggregate results: cannot write to 'test.system.foo' at src/mongo/shell/batch_api.js:612
       
      > db.system___foo.insert({})
      SingleWriteResult({
              "writeErrors" : [ ],
              "writeConcernErrors" : [ ],
              "nInserted" : 1,
              "nUpserted" : 0,
              "nUpdated" : 0,
              "nModified" : 0,
              "nRemoved" : 0,
              "upserted" : [ ]
      })
      > db.system___foo.renameCollection('system.foo')
      { "ok" : 1 }
      > db.system.foo.find()
      { "_id" : ObjectId("52f005ae6d0abd019aead824") }

      Attachments

        Activity

          People

            mathias@mongodb.com Mathias Stearn
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: