Configure MongoDB Network Access
MongoDB Atlas also restricts which IP addresses can access your database deployment.
Open Network Access in Atlas.
Add the public IP address of your development machine.
For local development, use the current public IP address rather than allowing every IP address.
Allowing 0.0.0.0/0 makes the database reachable from all IPv4 addresses, subject to authentication and other controls. It is not a recommended production configuration.
For production, use private networking or carefully controlled network access wherever possible.
Do not use unrestricted IP access for production databases. Restrict access to trusted networks and application infrastructure.
Atlas uses network access rules.
Allow your development IP address.
Restrict production database connectivity.