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

renameCollection permits creation of a collection which begins with "."

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.7.0
    • Affects Version/s: None
    • Component/s: Catalog
    • None
    • Fully Compatible
    • ALL
    • 9

      > db.foo.insert({x: 1})
      WriteResult({ "nInserted" : 1 })
      > db.foo.renameCollection(".")
      { "ok" : 1 }
      > db.listCollections()
      uncaught exception: TypeError: db.listCollections is not a function :
      @(shell):1:1
      > show tables
      .
      bug
      > db[".foo"].insert({x: 1})
      WriteCommandError({
      	"ok" : 0,
      	"errmsg" : "Collection names cannot start with '.'",
      	"code" : 73,
      	"codeName" : "InvalidNamespace"
      })
      

      It seems like we're just missing some validation on the target namespace.

            Assignee:
            katherine.wu@mongodb.com Katherine Wu (Inactive)
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: