MongoDB |
|
MongoDB is a part of our environment. I know very little about MongoDB but will document what I am learning as I am now supporting Mongo.
Good Times!!!!!
Good Times!!!!!
Find status of mongo cluster |
|
click on links for more details.
rs.status()
will tell you the status of the replicas in your mongodb configuration
db.isMaster()
will tell you status of current node you are on.
rs.status()
will tell you the status of the replicas in your mongodb configuration
db.isMaster()
will tell you status of current node you are on.
Create a database user |
|
below user has readWrite and basically db_owner permissions.
db.createUser(
{
user: "<dbname>",
pwd: “xxxxxxx”,
roles: ["readWrite","dbAdmin"]
}
db.createUser(
{
user: "<dbname>",
pwd: “xxxxxxx”,
roles: ["readWrite","dbAdmin"]
}
Login to Mongo as admin |
|
I need to login to Mongo as the admin user.
~#mongo -u root -p$(cat <path to credential file>) 127.0.01/admin
~#mongo -u root -p$(cat <path to credential file>) 127.0.01/admin