I'm having trouble connecting to a mongodb Atlas from a shared host, from my understanding it's because port 27017 is blocked by the firewall.
Any way to change the port number on mongodb Atlas?
this is the code on my nodejs file:
mongoose.connect("mongodb+srv://<username>:<password>@test-nhowr.mongodb.net/test?retryWrites=true&w=majority", {
useNewUrlParser: true,
useCreateIndex: true,
}).then(() => {
console.log("Connected to DB");
}).catch(err => {
console.log('ERROR Connecting to db!: ', err.message);
});
And this is the error I'm getting:
ERROR Connecting to db!: failed to connect to server [test-shard-00-00-nhowr.mongodb.net:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 54.172.133.240:27017