1
0
mirror of https://github.com/vimagick/dockerfiles.git synced 2024-11-24 08:52:31 +02:00
dockerfiles/mongo/README.md
2021-12-01 18:11:40 +08:00

709 B

mongo

MongoDB is an open-source, document database designed for ease of development and scaling.

up and running

$ pwgen -1 8 1
Aedahwa7

$ docker-compose up -d

$ docker-compose cp mongo:/usr/bin/mongo /usr/local/bin/

$ mongo mongodb://root:root@localhost:27017/admin
>>> use mydb
>>> db.createUser({user: 'myuser', pwd: 'Aedahwa7', roles: [{role: 'readWrite', db: 'mydb'}]})
>>> exit

$ mongo mongodb://myuser:Aedahwa7@localhost:27017/mydb
>>> show collections
>>> exit

Read this and this for more help.