I'm encountering an issue with connecting to my MongoDB Atlas database from my MacBook using Mongoose. The exact same code works fine on my Windows PC, but on my MacBook, I get the following error:enter image description here
Here are the details of my setup:
MongoDB Atlas Connection String: mongodb+srv://chamikajay:*******@authentication.u7j8j.mongodb.net/?retryWrites=true&w=majority&appName=authentication
MongoDB Cluster Name: authentication
Steps I’ve Tried:
Whitelisted IPs: I’ve added both my public IP and my MacBook’s local IP and Allow access from anywhere IP (0.0.0.0/0) mongodb to the MongoDB Atlas network access whitelist.
Verified Connection String: The connection string works fine on my Windows PC, but not on my MacBook.
Environment Details:
- OS: macOS
- Node.js Version: v14.17.0
- Mongoose Version: 6.x
- MongoDB Atlas Version: Free tier (M0)