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

Refactor host/port uri generation

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • None
    • 4.1.11
    • mongo-tools-common
    • None

    Description

      Tools need to generate a URI from various host/port combinations:

      noformat
      --host foo # single host
      --host foo --port 27017 # single host and port
      --host foo,bar # multiple host
      --host foo,bar --port 27107 # multiple host plus port
      --host foo:27017,bar:27107 # multiple host/port pair (but maybe invalid without repl set name?)

      1. For all the above, host can be prefixed with a replica set name

      --host setname/foo,bar --port 27107

      1. It's also possible to specify a port by itself

      --port 33333

       

      Logic to handle this is scattered, including:

      • options/options.go (ParseArgs)
      • db/db.go (configureClient)
      • helpers in util/mongo.go

      These should all be centralized and rationalized to convert any host/port combination into the expected URI and there should be unit testing for the conversions.

      Attachments

        Activity

          People

            backlog-server-tools Backlog - Server Tools Team
            david.golden@mongodb.com David Golden
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: