It is as simple as calling an URL
If you have already installed MongoDB.
If Not go-ahead download from here
var MongoClient = require('mongodb').MongoClient;
//Create a database named "testdb":
var url = "mongodb://localhost:27017/testdb";
MongoClient.connect(url, function(err, db) {
if (err) throw err;
console.log("Database created!");
db.close();
});