File: init_mongo.js

package info (click to toggle)
pwman3 0.13.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 636 kB
  • sloc: python: 3,421; makefile: 215; sh: 61; javascript: 6
file content (8 lines) | stat: -rw-r--r-- 283 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
// run this script with $ mongo < init_mongo.js

if ( !  db.getUser("tester") ) {
     db.createUser({user: "tester", pwd: "12345678",
                   roles: [{role: "dbAdmin", db: "pwmantest"},
                      {role: "readWrite", db: "pwmantest"},]
                   })
}