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

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Fixed
    • 3.2.3
    • 3.2.13, 3.3.10
    • Shell
    • Fully Compatible
    • ALL
    • v3.2
    • Hide

      See the description.

      Show
      See the description.
    • 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

              matt.cotter Matt Cotter
              kaloian.manassiev@mongodb.com Kaloian Manassiev
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: