Welcome aboard! We are happy you are here and wish you good net-raft!
// at first you install "npm install mongodb"
//put this code into app.js
var MongoClient = require('mongodb').MongoClient;
var url = "mongodb://localhost:27017/MyDB"; // single localhost server is running on 27017
MongoClient.connect(url, function(err, db) {
if (err) throw err;
console.log("Database created!");
db.close();
});
// type "node app.js" in command prompt
The most helpful NODEJS solutions
get user ipNODEJS Click to see more ... 7.6K 1.7K