Answer the question
In order to leave comments, you need to log in
`
Problem connecting mongoDB Atlas?
Good afternoon, there was a problem connecting to MongoDBAtlas. When I try to connect via
try{
const url = `mongodb+srv://denioo:<password>@cluster0-cn3cp.mongodb.net/test?retryWrites=true&w=majority`
await mongoose.connect(url, {useNewUrlParser: true})
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`)
})
}catch(e){
console.log(e)
}
Error: queryTxt EREFUSED cluster0-cn3cp.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (dns.js:202:19) {
errno: 'EREFUSED',
code: 'EREFUSED',
syscall: 'queryTxt',
hostname: 'cluster0-cn3cp.mongodb.net'
}
Answer the question
In order to leave comments, you need to log in
I was able to connect via driver version 2.2.12
, the connection string looks like this:
mongodb://username:<password>@cluster0-shards-00-00-jipa1.mongodb.net:27017,cluster0-shards-00-01-jipa1.mongodb.net:27017,cluster0-shards-00-02-jipa1.mongodb.net:27017/test?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin&retryWrites=true&w=majority
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question