Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-3336

Clarify Default Connection String for Shell

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • v1.3.7
    • Affects Version/s: None
    • Component/s: manual
    • Labels:
      None

      Some minor clarification to the http://docs.mongodb.org/manual/reference/program/mongo/ page


      Unfortunately, the shell doesn't quite agree with all the other tools
      about how it processes command line arguments and options.
      Specifically:

      the shell parses its first non-option argument as [hostname[:port]/]dbname.

      The other tools take a --host, --port, and --db option, which are
      the only way to point these tools at a MongoDB deployment. The --host
      must either parse as an IP address or else resolve as a hostname, the
      port must parse as a port number, and the db must be a valid database
      name.

      The shell also takes the --host and --port options, but if you
      supply them, then you can't use the hostname and port number as part
      of the non-optional argument, but can only specify a database name.

      The shell does not take a --db option.

            Assignee:
            tim.slavin Tim Slavin
            Reporter:
            sam.kleinman Sam Kleinman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              9 years, 46 weeks, 1 day ago