diff options
author | Matt Cotter <matt.cotter@mongodb.com> | 2016-12-06 14:05:28 -0500 |
---|---|---|
committer | Matt Cotter <matt.cotter@mongodb.com> | 2016-12-12 14:17:43 -0500 |
commit | b9c59fd5c79c0b0d9c845e3c05e50ab1dd9f7f4a (patch) | |
tree | 0b8b345a678358531e2b8a46b5cc9c9859ce9fec /src/mongo/shell/mongo.js | |
parent | e4ccedc08b69cdebdf3c2ed707d07f2a78036b42 (diff) | |
download | mongo-b9c59fd5c79c0b0d9c845e3c05e50ab1dd9f7f4a.tar.gz |
SERVER-27289 fix ConnectionString parsing in shell
Diffstat (limited to 'src/mongo/shell/mongo.js')
-rw-r--r-- | src/mongo/shell/mongo.js | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mongo/shell/mongo.js b/src/mongo/shell/mongo.js index cbc7386f0f9..d50463bc3bc 100644 --- a/src/mongo/shell/mongo.js +++ b/src/mongo/shell/mongo.js @@ -221,12 +221,10 @@ connect = function(url, user, pass) { } if (!url.startsWith("mongodb://")) { - var colon = url.lastIndexOf(":"); - var slash = url.lastIndexOf("/"); + const colon = url.lastIndexOf(":"); + const slash = url.lastIndexOf("/"); if (slash == -1 && colon == -1) { url = "mongodb://127.0.0.1:27017/" + url; - } else { - url = "mongodb://" + url; } } |