Created
April 12, 2019 18:53
-
-
Save crizstian/b3c2e3529571c6adbed785c24f96a300 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
admin = db.getSiblingDB("admin") | |
admin.createUser( | |
{ | |
user: "{{ env "DB_ADMIN_USER" }}", | |
pwd: "{{ env "DB_ADMIN_PASS" }}", | |
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ] | |
} | |
) | |
db.getSiblingDB("admin").auth("{{ env "DB_ADMIN_USER" }}", "{{ env "DB_ADMIN_PASS" }}" ) | |
db.getSiblingDB("admin").createUser( | |
{ | |
"user" : "{{ env "DB_REPLICA_ADMIN" }}", | |
"pwd" : "{{ env "DB_REPLICA_ADMIN_PASS" }}", | |
roles: [ { "role" : "clusterAdmin", "db" : "admin" } ] | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment