Solucionado (ver solução)
Solucionado
(ver solução)
2
respostas

Erro conexão com o Mongo

Boa tarde, tentando conectar, cai no seguinte erro:

Erro de Conexão MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/ at NativeConnection.Connection.openUri (C:\Users\ilso_\OneDrive\Área de Trabalho\alura-node\node_modules\mongoose\lib\connection.js:807:32) at C:\Users\ilso_\OneDrive\Área de Trabalho\alura-node\node_modules\mongoose\lib\index.js:342:10 at C:\Users\ilso_\OneDrive\Área de Trabalho\alura-node\node_modules\mongoose\lib\helpers\promiseOrCallback.js:32:5 at new Promise () at promiseOrCallback (C:\Users\ilso_\OneDrive\Área de Trabalho\alura-node\node_modules\mongoose\lib\helpers\promiseOrCallback.js:31:10) at Mongoose.promiseOrCallback (C:\Users\ilso\OneDrive\Área de Trabalho\alura-node\node_modules\mongoose\lib\index.js:1176:10) at Mongoose.connect (C:\Users\ilso_\OneDrive\Área de Trabalho\alura-node\node_modules\mongoose\lib\index.js:341:20) at file:///C:/Users/ilso_/OneDrive/%C3%81rea%20de%20Trabalho/alura-node/src/config/dbConnect.js:3:10 at ModuleJob.run (node:internal/modules/esm/module_job:198:25) at async Promise.all (index 0) { reason: TopologyDescription { type: 'ReplicaSetNoPrimary', servers: Map(3) { 'ilso-shard-00-02.khelv.mongodb.net:27017' => [ServerDescription], 'ilso-shard-00-00.khelv.mongodb.net:27017' => [ServerDescription], 'ilso-shard-00-01.khelv.mongodb.net:27017' => [ServerDescription] }, stale: false, compatible: true, heartbeatFrequencyMS: 10000, localThresholdMS: 15, setName: 'atlas-q2gr8f-shard-0', logicalSessionTimeoutMinutes: undefined } } node:internal/process/promises:279 triggerUncaughtException(err, true /* fromPromise */);

2 respostas

Insira aqui a descrição dessa imagem para ajudar na acessibilidade

solução!

resolvido, está dando conflito de IP por algum motivo. Só acessar: https://www.whatismyip.com/ e trocar o IP nas configurações do mongo.