4 MINDS

Sistema para Gestão de Conhecimento

Mongo 2.6 create new user





use admin

db.createUser({ user: 'user', pwd: 'password', roles: [ 'userAdminAnyDatabase' ] })

or

db.createUser({user:"username",pwd:"password", roles:[{role:"root",db:"admin"}]})

use dbname

db.createUser(
    {
      user: "username",
      pwd: "passsowrd",
      roles: ["readWrite"]
    }
)