Last active
December 13, 2016 07:10
-
-
Save RICH0423/b5bd77cd70cc7bac357efe3dc6c6adc7 to your computer and use it in GitHub Desktop.
MongoDB add backup role
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
| > db.getUsers() | |
| [ | |
| { | |
| "_id" : "admin.ssir-admin", | |
| "user" : "ssir-admin", | |
| "db" : "admin", | |
| "roles" : [ | |
| { | |
| "role" : "readWrite", | |
| "db" : "admin" | |
| }, | |
| { | |
| "role" : "userAdminAnyDatabase", | |
| "db" : "admin" | |
| } | |
| ] | |
| } | |
| ] | |
| db.updateUser( "ssir-admin", | |
| { | |
| roles : [ | |
| { | |
| "role" : "readWrite", | |
| "db" : "admin" | |
| }, | |
| { | |
| "role" : "userAdminAnyDatabase", | |
| "db" : "admin" | |
| }, | |
| { | |
| "role" : "backup", | |
| "db" : "admin" | |
| } | |
| ] | |
| } | |
| ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment