skip to Main Content

Mongodb – MongoClient.connect not working in node.js

var MongoClient = require('mongodb').MongoClient; var url = 'mongodb://localhost:27017/mydb' MongoClient.connect(url, function(err,db) { if (err) { console.log("err") } else { console.log("Database Connected") } }) .connect is striked off in VS Code err is displayed in the VS Code terminal Node.js node-v18.12.0-x64 Mongodb…

VIEW QUESTION
Back To Top
Search