var MongoClient = require(‘mongodb’).MongoClient;
// Connect to the db
MongoClient.connect(“mongodb://127.0.0.1:27017/newdb”,function(err, db) {
if(!err) {
console.log(“You are connected!”);
};
db.close();
});
i am not getting any output on the terminal
Hey @Jeny_Jijo,
Please refer to the NodeJs Quick Start documentation for the code snippet and reference, and make sure you have MongoDB, Node, and npm correctly installed on your system.
Please feel free to reach out in case of further questions.
Best regards,
Kushagra