Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-22707

MongoDB shell's parsing of connection string uses incorrect regular expression

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 3.2.3
    • Fix Version/s: 3.2.13, 3.3.10
    • Component/s: Shell
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Backport Requested:
      v3.2
    • Steps To Reproduce:
      Hide

      See the description.

      Show
      See the description.
    • Sprint:
      Platforms 17 (07/15/16)

      Description

      The JS parsing of the mongodb connection string is incorrect:

      > var mongoHost = 'mongodb://kaloianm-ubuntu:12345/?connectTimeoutMS=30000&socketTimeoutMS=30000';
       
      > mongoHost
      mongodb://kaloianm-ubuntu:12345/?connectTimeoutMS=30000&socketTimeoutMS=30000
       
      > var mongo = new Mongo(mongoHost);
      2016-02-17T16:17:10.121-0500 E QUERY    [thread1] Error: Unknown exception :
      @(shell):1:17
      

      The reason why it fails is that the regular expression used by the MongoURI parser treats the entire string as the hostname.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: