Skip to content
Alexandr Sarmanov edited this page Jul 2, 2015 · 6 revisions

Mongo db tips

Create mongodb admin user

db.createUser({user: "admin", pwd: "admin", roles: [{role: "userAdminAnyDatabase", db: "admin"}]});

Create mongodb user for db, mongo command line

use db; //switched to db

db.createUser({user: "xxx",pwd: "xxx",roles: [ { role: "userAdmin", db: "db"}]})

Clone this wiki locally