How can I connect without to a distant database (MONGOHQ) without using MongoClient.connect() ?
var db, mongo, server;
mongo = require("mongodb");
server = new mongo.Server("mongodb://login:[email protected]:10057//appname", 10057, {
auto_reconnect: true
});
db = new mongo.Db("confirmed", server, { safe: true });
the message I get from my server is
[Error: failed to connect to [mongodb://login:[email protected]:10057//appname:10057]]
Any ideas ?
mongoshell using the same credentials? Sample command line:mongo -u login -p password paulo.mongohq.com:10057/appname. It looks like you have an extra "/" before appname, and you have also duplicated the port number (10057). I suspect your Node.js connection string should beserver = new mongo.Server("mongodb://login:[email protected]:10057/appname");.