-
-
Save chiarabeth/e7f8de61122f52e6f49d9a782500a615 to your computer and use it in GitHub Desktop.
Docker Mongo Step 7a
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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