Last active
November 14, 2017 20:40
-
-
Save geek182/659ec1401a4b5cbbf91848f559d1d509 to your computer and use it in GitHub Desktop.
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
# CREATE USER ADD ROLE | |
use mydb | |
db.createUser( | |
{ | |
user: "accountUser", | |
pwd: "password", | |
roles: [ "readWrite", "dbAdmin" ] | |
} | |
) | |
#show dbs | |
show dbs | |
#extend info for monitoring | |
db.serverStatus() | |
#specif info for monitoring | |
db.serverStatus().uptime | |
#Get loglevel | |
#The verbosity level can range from 0 to 5: | |
#0 is the MongoDB’s default log verbosity level, to include Informational messages. | |
#1 to 5 increases the verbosity level to include Debug messages. | |
# -1 to inherit the verbosity of the parent. | |
db.getLogComponents() | |
#set loglevel | |
db.setLogLevel(-1, "query") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment