Setting up a whitelist in Mongo DB Atlas?

Ok. I’m just getting started with the microservice API’s and I have set up an instance on Mongo Atlas. I’m not using mongoose because I’ve previously taken a class on how to do things with the Mondo Node driver and I also don’t want to use MLab because it’s being acquired and getting converted over to Atlas so I figure that I should just go to the source.

My question is, Atlas required you to set up a whitelist of IP addresses that can access the DB. In development, this is easy because I just have my own IP address whitelisted. However, if I were to go put this up on heroku, or even try using it on glitch it needs those IP’s whitelisted. I know I can enter a range and just whitelist ALL IP’s, but that seems like a terrible idea. So, what’s a better approach?

1 Like

Hi @ryanmdoyle. You can whitelist all IPs by clicking “Allow Access From Anywhere” in settings or by providing the whitelist IP: 0.0.0.0/0

I was setting up a Heroku app using Mongo Atlas recently and found the official MongoDB video series very helpful. Here’s the link to the whitelisting stage: https://www.youtube.com/watch?v=leNNivaQbDY

2 Likes