renameCollection allows renaming to system collections

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.6.0-rc0
    • Affects Version/s: None
    • Component/s: Admin
    • None
    • Minor Change
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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") }
      

            Assignee:
            Mathias Stearn
            Reporter:
            Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: