skip to Main Content

Mongodb – MongoServerSelectionError: connection <monitor> to xx.xxx.xxx.xxx:27017 closed (whitelisting IP and opening the port didn't work)

i'm learning MongoDB and i'm sorry to bother you but i'm getting this error: MongoServerSelectionError: connection <monitor> to xx.xxx.xxx.xxx:27017 closed at Timeout._onTimeout (C:...node_modulesmongodblibsdamtopology.js:305:38) at listOnTimeout (node:internal/timers:559:17) at processTimers (node:internal/timers:502:7) { reason: TopologyDescription { type: 'ReplicaSetNoPrimary', servers: Map(3) { 'ac-c9obg9r-shard-00-00.onq7cwz.mongodb.net:27017' =>…

VIEW QUESTION

Connecting to MongoDB database

I am trying to connect to a MongoDB database.I have followed all the steps here https://youtu.be/EcJERV3IiLM but am getting an error. The index.js file looks like this, const dotenv = require('dotenv') dotenv.config() const mongodb = require('mongodb') mongodb.connect(process.env.CONNECTIONSTRING, async function(err,client){ const…

VIEW QUESTION
Back To Top
Search