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

Shell transposes DB and host in [db Address] specification

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • 3.4.11
    • None
    • None
    • CentOs 7
    • If this is the new way to specify a DB and host, then the --help option on Mongo Shell 3.4.11 needs to be updated to reflect that fact.

    Description

      It seems that the command line is transposing the host and db when using the host formats specified in the command line usage text:

      192.168.0.5/foo

      or

      192.168.0.5:9999/foo

      I receive the following errors respectively when connecting using these formats to a valid host and DB.

      Error: Database name cannot have reserved characters for mongodb:// URL: mongodb://foo:27017/192.168.0.5

      Error: Database name cannot have reserved characters for mongodb:// URL: mongodb://foo:27017/192.168.0.5%3A9999

      If I provide an incorrect host specification as

      mongo -u <user> -p <pass> foo/192.168.0.5:9999

      , then the shell will connect as normal.

      Attachments

        Issue Links

          Activity

            People

              mark.agarunov Mark Agarunov
              tankertux Jordan Grant
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: