Can't connect to a MongoDB using Node.js.
This is my code (mdb.js):
var MongoClient = require('mongodb').MongoClient, format = require('util').format;
MongoClient.connect('mongodb://localhost:3000', function(err,db){
if(err){
throw err;
} else {
console.log("Connected");
}
db.close();
});
node mdb.js prints MongoError:
via smus
No comments:
Post a Comment