cjvt-valency/dockerfiles/database/mongo_init_db.sh
2019-03-14 18:40:56 +01:00

17 lines
409 B
Bash
Executable File

#!/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"]})