Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-2663

mongorestore - Can't use database name with uri flag

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.2.8
    • Component/s: mongorestore
    • Environment:
      mongorestore version: r4.2.8
      git version: 43d25964249164d76d5e04dd6cf38f6111e21f5f
      Go version: go1.12.17
         os: darwin
         arch: amd64
         compiler: gc

      If you run the mongorestore with the database name in the uri you will get an error. For example: 

      mongorestore --drop --uri mongodb://localhost/mydb --collection languages ./languages.bson

      {{ 2020-07-17T14:17:09.142-1000 Failed: cannot restore a collection without a specified database}}

      However, if you add --db, which the documentation warns you should not do, it works just fine.

       

       

            Assignee:
            tim.fogarty@mongodb.com Tim Fogarty
            Reporter:
            jonah@surveyplanet.com Jonah Werre
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: