User Tools

Site Tools


mongodb

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revision Both sides next revision
mongodb [2017/01/05 06:24]
felixonmars created
mongodb [2017/01/06 07:46]
felixonmars
Line 4: Line 4:
 $ mongo $ mongo
 > db = db.getSiblingDB('​admin'​) > db = db.getSiblingDB('​admin'​)
-> db.addUser({user: "​username",​ pwd: "​password",​ roles: ["​userAdminAnyDatabase"​]})+> db.createUser({user: "​username",​ pwd: "​password",​ roles: ["​userAdminAnyDatabase"​]})
 </​code>​ </​code>​
  
Line 11: Line 11:
 $ mongo $ mongo
 > db = db.getSiblingDB('​admin'​) > db = db.getSiblingDB('​admin'​)
-> db.addUser({user: "​username",​ pwd: "​password",​ roles: ["​dbAdminAnyDatabase",​ "​userAdminAnyDatabase",​ "​readWriteAnyDatabase",​ "​clusterAdmin"​]})+> db.createUser({user: "​username",​ pwd: "​password",​ roles: ["​dbAdminAnyDatabase",​ "​userAdminAnyDatabase",​ "​readWriteAnyDatabase",​ "​clusterAdmin"​]})
 </​code>​ </​code>​
  
mongodb.txt ยท Last modified: 2017/01/06 07:47 by felixonmars