MongoDB Commands and to connect Docker commands
mongodb://max:secret@mongodb:27017/course-goals?authSource=admin
mongodb://max:secret@172.19.0.2:27017/course-goals?authSource=admin
sudo mongosh "mongodb://max:secret@172.19.0.2:27017/course-goals?authSource=admin"
mongosh
cls
show dbs
use admin
db.createUser({user: "kishore", pwd: passwordPrompt(), roles: [{role: "read" , db: "admin"}]})
db.createUser({user: "kumar", pwd: "Man", roles: [{role: "read" , db: "admin"}, {role: "readWrite" , db: "config"}]})
db.createUser({user: "kumar", pwd: "Man", roles: [{role: "readWrite" , db: "admin"}]})
show users
show roles
db.users.insertOne({name: "kishore"})
admin> show users
admin> use course-goals
switched to db course-goals
course-goals> show collections
goals
course-goals> db.goals.find().pretty()-