Skip to content

Instantly share code, notes, and snippets.

@chiarabeth
Created Aug 24, 2021
Embed
What would you like to do?
Docker Mongo Step 7a
conn = new Mongo("mongo_source");
db = conn.getDB("admin");
db.auth("root", "rootpassword");
db.dropUser("lowAccessUser");
db.dropRole("lowAccessRole");
db.createRole({role: "lowAccessRole",
roles: [],
privileges: [
{resource: {db: "tutorial_db", collection: "Restaurants"}, actions: ["listCollections"] }
]
});
db.createUser({user: "lowAccessUser", pwd: "lowaccessuserpassword", roles: [{role: "lowAccessRole", db: "admin"}]});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment