cjvt-valency/dockerfiles/database/mongo_init_db.sh

17 lines
409 B
Bash
Raw Normal View History

2019-03-14 17:40:56 +00:00
#!/bin/bash
echo "exiting - check script"
exit
# obviously, change root and password!
# db names: nameDB
# collection names: lower case, plural
# user names?
# mongo admin -u root -p password --eval "db.getSiblingDB('vlDB').addUser('vluser', 'password')"
docker exec -it mongo-container /bin/bash
mongo -u root -p example
use valDB
db.createUser({user: "kristjan", pwd: "password", roles: ["readWrite"]})