skip to Main Content

Mongodb – got and error when i connect mongo db to nodejs

```const timeoutError = new error_1.MongoServerSelectionError(Server selection timed out after ${serverSelectionTimeoutMS} ms, this.description); .MongoServerSelectionError: connect ECONNREFUSED ::1:27017 const {MongoClient}=require('mongodb'); const url='mongodb://localhost:27017/'; const client= new MongoClient(url); const dataBase= 'nodejs'; async function getdata(){ let result= await client.connect(); console.log('connect to server') let db= result.db(dataBase)…

VIEW QUESTION
Back To Top
Search