how to use mongo db for creating user and login code example
Example 1: mongodb add user
use <your database>
db.createUser({
user: '<some username>',
pwd: passwordPrompt(),
roles: [{
role: 'readWrite',
db: '<your database>'
}]
})
Example 2: mongo db shell user login
$ mongo admin -u uname -p 'password'