[SERVER-22707] MongoDB shell's parsing of connection string uses incorrect regular expression Created: 17/Feb/16 Updated: 10/Apr/17 Resolved: 14/Jul/16 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Shell |
| Affects Version/s: | 3.2.3 |
| Fix Version/s: | 3.2.13, 3.3.10 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kaloian Manassiev | Assignee: | Matt Cotter |
| Resolution: | Done | Votes: | 0 |
| Labels: | bkp | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||
| Operating System: | ALL | ||||||||||||||||||||
| Backport Requested: |
v3.2
|
||||||||||||||||||||
| Steps To Reproduce: | See the description. |
||||||||||||||||||||
| Sprint: | Platforms 17 (07/15/16) | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
The JS parsing of the mongodb connection string is incorrect:
The reason why it fails is that the regular expression used by the MongoURI parser treats the entire string as the hostname. |
| Comments |
| Comment by Githook User [ 10/Apr/17 ] | |||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'Machyne', u'name': u'Matt Cotter', u'email': u'matt.cotter@mongodb.com'}Message:
(cherry picked from commit 40f774eafa4c0394cc75c936143ce6e185e5b1eb) | |||||||||||||||||||||||||||||||||||||
| Comment by Githook User [ 14/Jul/16 ] | |||||||||||||||||||||||||||||||||||||
|
Author: {u'username': u'Machyne', u'name': u'Matt Cotter', u'email': u'matt.cotter@mongodb.com'}Message:
| |||||||||||||||||||||||||||||||||||||
| Comment by Kaloian Manassiev [ 17/Feb/16 ] | |||||||||||||||||||||||||||||||||||||
|
For some reason, the order of the options matters: This errors out:
This succeeds:
| |||||||||||||||||||||||||||||||||||||
| Comment by Kaloian Manassiev [ 17/Feb/16 ] | |||||||||||||||||||||||||||||||||||||
|
Single option does not work when you go through the MongoURI constructor either (new Mongo from JS). Regardless of whether it has database or not:
So I think this ticket is more generic than | |||||||||||||||||||||||||||||||||||||
| Comment by Kevin Pulo [ 17/Feb/16 ] | |||||||||||||||||||||||||||||||||||||
|
Dupe of This doesn't work for me whether via cmdline or Mongo constructor. Whereas a simpler uri works fine via the Mongo constructor.
|