I am trying to figure out how to connect to my mongodb db using the native node mongo driver and I have two issues:
- My password contains an @ sign making it break the normal user:pass@host connection string format
- How do I list databases from what I have below?
Any ideas on how to address this?
Here is an attempt which does not work:
var Mongo = require('mongodb');
var server = new Mongo.Server('mongodb://myhost', 27017);
var db = new Mongo.Db('test', server);
db.open(function(err, db) {
console.log(err); //unable to connect
});