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

mongorestore - Can't use database name with uri flag

    XMLWordPrintable

    Details

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

      Description

      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.

       

       

        Attachments

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved: