Restrict IP MongoDB Compass connection

Hi, I want to restrict some certain IPs for connection with MongoDB Compass, but for the Database itself Access from anywhere. I’ve tried Add a connection IP address but it restricts only to the Database, what I want is the restriction for MongoDB Compass. How can I do that?


I do not think it would make sense to leave your database open to any application and block one of the legitimate one.

Hi @acb7881 welcome to the community!

To add a bit of colour to @steevej’s answer, I don’t think at this moment you can restrict connection by application, only by IP. I believe what you need is to use proper authentication & authorization, where you only give enough privileges for an account to do what they need, and no more. See Configure Database Users and Role-Based Access Control for more information.

Best regards