mongodb make user with access to one database code example
Example: mongodb add user
use <your database>
db.createUser({
user: '<some username>',
pwd: passwordPrompt(),
roles: [{
role: 'readWrite',
db: '<your database>'
}]
})
use <your database>
db.createUser({
user: '<some username>',
pwd: passwordPrompt(),
roles: [{
role: 'readWrite',
db: '<your database>'
}]
})