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

Mongo connection uri doesn't support @ character in database name

    XMLWordPrintable

Details

    • Minor Change
    • ALL
    • v3.4
    • Hide

      christian@katt-lnvo:~$ mongo mongodb://10.123.176.52/demo@saas
      MongoDB shell version v3.4.5
      connecting to: mongodb://10.123.176.52/demo@saas
      2017-06-29T10:40:56.722-0300 I NETWORK  [thread1] getaddrinfo("saas") failed: Name or service not known
      2017-06-29T10:40:56.722-0300 E QUERY    [thread1] Error: couldn't initialize connection to host saas, address is invalid :
      connect@src/mongo/shell/mongo.js:237:13
      @(connect):1:6
      exception: connect failed
      

      I try to scape the character but It doesn't work

      christian@katt-lnvo:~$ mongo mongodb://10.123.176.52/demo%40saas
      MongoDB shell version v3.4.5
      connecting to: mongodb://10.123.176.52/demo%40saas
      MongoDB server version: 3.4.4
      rs1:PRIMARY> db
      demo%40saas
      rs1:PRIMARY> 
      

      Show
      christian@katt-lnvo:~$ mongo mongodb://10.123.176.52/demo@saas MongoDB shell version v3.4.5 connecting to: mongodb://10.123.176.52/demo@saas 2017-06-29T10:40:56.722-0300 I NETWORK [thread1] getaddrinfo("saas") failed: Name or service not known 2017-06-29T10:40:56.722-0300 E QUERY [thread1] Error: couldn't initialize connection to host saas, address is invalid : connect@src/mongo/shell/mongo.js:237:13 @(connect):1:6 exception: connect failed I try to scape the character but It doesn't work christian@katt-lnvo:~$ mongo mongodb://10.123.176.52/demo%40saas MongoDB shell version v3.4.5 connecting to: mongodb://10.123.176.52/demo%40saas MongoDB server version: 3.4.4 rs1:PRIMARY> db demo%40saas rs1:PRIMARY>
    • Platforms 2017-07-31, Platforms 2017-08-21, Platforms 2017-09-11, Platforms 2017-10-02

    Description

      "@" is a valid caracter for database names but it is not supported in shell connection uri.

      Attachments

        Issue Links

          Activity

            People

              sara.golemon@mongodb.com Sara Golemon
              akattunga Christian
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: