Created
March 3, 2016 17:21
-
-
Save imaustink/f16a80b1b4d70f16e8c5 to your computer and use it in GitHub Desktop.
Simple Mongo DB connection URL generator in JavaScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mongoURL(options) { | |
options = options || {}; | |
var URL = 'mongodb://'; | |
if (options.password && options.username) URL += options.username + ':' + options.password + '@'; | |
URL += (options.host || 'localhost') + ':'; | |
URL += (options.port || '27017') + '/'; | |
URL += (options.database || 'admin'); | |
return URL; | |
} |
ABIDKHAN2626
commented
Sep 6, 2024
- 2
Bot
abidkhanbaloch3
Very good
WhatsApp bot
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment