-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Minor - P4
-
Affects Version/s: 1.20.5
-
Component/s: Compass
-
None
-
Environment:macOS 10.14.6
-
Not Needed
-
None
Original Connection String: mongodb://uuuuu:xxx@mongo1.cc.org:27117,mongo2.cc.org:27117,mongo3.cc.org:27117?authSource=admin&replicaSet=rsP1edg1&readPreference=primary&appname=MongoDB%20Compass&ssl=false
Add a space after the first comma in the connection string
Click "Fill in connection fields individually"
Click "Paste connection string"
New Connection string is missing 2nd node member.
mongodb://uuuuu:xxx@mongo1.cc.org:27117,:27017,mongo3.cc.org:27117/test?authSource=admin&replicaSet=rs0&readPreference=primary&appname=MongoDB%20Compass&ssl=false
Note, the port number changed to 27017 for the 2nd listed replica set node.
Added a space between each [node]:[port] name for a total of 3 spaces. It appears the connection is saved successfully.
Repeat above steps.
Resulting connection string is:
mongodb://uuuuu:xxx@mongo1.cc.org:27117,:27017,:27017/test?authSource=admin&replicaSet=rs0&readPreference=primary&appname=MongoDB%20Compass&ssl=false
____________________
Another way that spaces affect connection string:
Original connection string: Note the space after ":" in 2 places.
mongodb://testUser:password@xx1: 27117,xx2: 27117,xx3:27117/?authSource=admin&replicaSet=rs0&readPreference=primary&appname=MongoDB Compass&ssl=false
Click "Fill in connection fields individually"
New connection string:
mongodb://testUser:password@xx1:27017,xx2:27017,xx3:27117/test?authSource=admin&replicaSet=rs0&readPreference=primary&appname=MongoDB%20Compass&ssl=false
Port number changed in 2 places.