Couldn’t connect with atlas database
See original GitHub issuewhen I tried to connect to an atlas database using:
import { MongoClient } from "https://deno.land/x/mongo@v0.21.0/mod.ts";
const client = new MongoClient();
await client.connect(
"mongodb+srv://Eyoatam:" +
Deno.env.get("MONGO_ATLAS_PASSWORD") +
"@cluster0.xrb4d.mongodb.net/<dbname>?retryWrites=true&w=majority"
);
It threw the following error:
error: Uncaught (in promise) Error: failed to lookup address information: nodename nor servname provided, or not known
at processResponse (deno:core/core.js:223:11)
at Object.jsonOpAsync (deno:core/core.js:240:12)
at async Object.connect (deno:cli/rt/30_net.js:224:13)
at async MongoClient.connect (client.ts:41:14)
at async app.ts:4:1
is there another way to connect with mongodb atlas?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:22 (7 by maintainers)
Top Results From Across the Web
Troubleshoot Connection Issues — MongoDB Atlas
Connecting IP address not in IP Access List. Before connecting to your Atlas database deployment, check that you added your host's IP address...
Read more >"Could not connect to any servers in your MongoDB Atlas ...
In your Mongo project, go to the network access section, and edit the IP to allow access from anywhere (0.0.0.0/0). Ensure that strong ......
Read more >Couldn't connect with atlas database · Issue #172 - GitHub
when I tried to connect to an atlas database using: import { MongoClient } from "https://deno.land/x/mongo@v0.21.0/mod.ts"; const client ...
Read more >Error on atlas-debug server app - Database: JIRA c...
Hello everyone, I'm trying atlas-debug for an existing JIRA plugin ... Error on atlas-debug server app - Database: JIRA couldn't connect to ...
Read more >MongoDB failed to connect - DatabaseFAQs.com
As you can see, when we try to connect to the server we got the error “couldn't connect to the server”. To resolve...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Hi everyone, I was trying to connect to the Atlas database. I have tried all the possible solutions above. finally, I can connect with this way
You should set your primary cluster address to host. After that, It should connect successfully. I think you are getting an error while finding objects.
Can you try this? It works for me.