This is the first time I use MongoDB Atlas to work with Mongo, and while trying to connect, that's the error I get:
Error: connect ECONNREFUSED 3.209.60.172:27017
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1054:14) {
name: 'MongoNetworkError',
errorLabels: [ 'TransientTransactionError' ],
[Symbol(mongoErrorContextSymbol)]: {}
}
This is my code:
const express = require('express');
const mongoose = require('mongoose');
const app = express();
mongoose.connect('mongodb+srv://johnnybox:<password>@cluster0-cgxqx.mongodb.net/test?retryWrites=true&w=majority', {
useNewUrlParser: true
}).then(() => console.log('MongoDB Connected...'))
.catch(err => console.log(err));
app.use(express.json());
app.use(express.urlencoded({ extended: true }));
app.use(require('./routes'));
app.listen(3331);
ps* I'm not missing my credentials
Already looked for a solution here but there's nothing similar to my problem.
My whitelist: