Don't force port to be specified in mongoURI

http://regexr.com/3cncm
This commit is contained in:
Henrik Malmberg
2016-02-03 10:09:57 +01:00
parent 51dfc62ba8
commit 456392df4a

View File

@@ -35,7 +35,7 @@ ExportAdapter.prototype.connect = function() {
}
//http://regexr.com/3cn6m
if (!this.mongoURI.match(/^mongodb:\/\/((.+):(.+)@)?([^:@]+):([^:]+)\/(.+?)$/gm)) {
if (!this.mongoURI.match(/^mongodb:\/\/((.+):(.+)@)?([^:@]+):{0,1}([^:]+)\/(.+?)$/gm)) {
throw new Error("Invalid mongoURI: " + this.mongoURI)
}
var usernameStart = this.mongoURI.indexOf('://') + 3;