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

Shell transposes DB and host in [db Address] specification

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.4.11
    • Component/s: None
    • Labels:
    • Environment:
      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.

      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.

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

              Created:
              Updated:
              Resolved: