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 |
---|---|---|---|
How to automatically pull in any relationships on Mongodb flexable sync | 3 | 605 | May 2024 |
Time to scale a cluster with 3 nodes from m30 to m40 | 1 | 231 | Jul 2024 |
mongodb pods are not rescheduling in kubernetes | 1 | 51 | Oct 2024 |
How Can I Get the MongoDB Atlas IP Address for Whitelisting in My Hosting Provider? | 1 | 70 | Feb 7 |
Low perf on regex search even on M50 instance | 1 | 33 | Nov 2024 |