Mongodb – restrict user’s access on a certain IP


Like in a certain way in MySQL.

CREATE 'dbuser'@'' identitifed by 'password';

GRANT USAGE on *.* to 'dbuser'@'';

We are not using any mongodb tools except for Robo

Best Answer

When you create a user then you can specify Authentication Restrictions

Would be like this:

use admin
     user: "dbuser",
     pwd: "password"
     roles: [ { role: "readWrite", db: "reporting" } ],
     authenticationRestrictions: [ {
        clientSource: [""],
        serverAddress: [""]
     } ]

But for me it is not clear, if you are looking for this.