Hello community,
I am working on the ExpressJS web services project. We have created a free cluster in MongoDB Atlas and I am trying to connect to the DB using the connection string provided by the website itself (mongodb+srv://:@cluster0.0jqio.mongodb.net/?retryWrites=true&w=majority). I have whitelisted my own IP and made it accessible from anywhere as well.
Sometimes it is connected but sometimes it gives me error “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://www.mongodb.com/docs/atlas/security-whitelist/”.
But I do not think that is the issue as I was able to connect to the cluster using my MongoDB Compass, Mongosh and VS Code MongoDB extension.
Skip to main content
Hello @Tien_Pham1 … If you can consistently, every time, connect via Compass, Mongosh, and VSCode and only experience failures in your application coded using ExpressJS, then there is either a bug in your application code or in ExpressJS itself.
New & Unread Topics
Topic | Replies | Views | Activity |
---|---|---|---|
AWS VPC peering with Atlas from our VPC with multiple CIDR ranges | 0 | 307 | May 2024 |
Local Runable docker container for MongoAtlas + Streams | 0 | 461 | Jun 2024 |
Appservices CLI does not have access to VALUES in the app | 0 | 26 | Aug 2024 |
How to improve the search accuracy of MongoDBAtlasVectorSearch | 0 | 21 | Sep 2024 |
Node JS connection error | 1 | 192 | Oct 2024 |