Nodejs MongoDB Collections
Create a file “node-mongo.js” with below code.
var mdb = require('mongodb').MongoClient;
var con = "mongodb://localhost:27017";
mdb.connect(con,{ useNewUrlParser: true, useUnifiedTopology: true }, function(err, db) {
if (err) throw err;
var dbase = db.db("employee");
dbase.createCollection("employees", function(err, res) {
if (err) throw err;
console.log("Collection is created!");
db.close();
});
});
Below SS shows the output of this program.

Below SS shows the output from MongoDB
