Iam beginner, first i installed npm install mongodb, then i create js file as demo_create_mongo_db.js
I used following code to create database
var MongoClient = require('mongodb').MongoClient;
//Create a database named "mydb":
var url = "mongodb://localhost:27017/mydb";
MongoClient.connect(url, function(err, db) {
if (err) throw err;
console.log("Database created!");
db.close();
});
then i just run node demo_create_mongo_db.js following error occured
Why this error occur? how can i handle this?
Thanks
