1
2
mirror of https://github.com/vimagick/dockerfiles synced 2024-06-16 11:58:47 +00:00
dockerfiles/mongo/README.md

31 lines
709 B
Markdown
Raw Normal View History

2016-02-02 09:15:48 +00:00
mongo
=====
[MongoDB][1] is an open-source, document database designed for ease of development and scaling.
## up and running
```bash
2021-12-01 03:31:58 +00:00
$ pwgen -1 8 1
2016-02-02 09:15:48 +00:00
Aedahwa7
$ docker-compose up -d
2021-12-01 10:11:40 +00:00
$ docker-compose cp mongo:/usr/bin/mongo /usr/local/bin/
2016-02-02 09:15:48 +00:00
2021-12-01 03:31:58 +00:00
$ mongo mongodb://root:root@localhost:27017/admin
>>> use mydb
>>> db.createUser({user: 'myuser', pwd: 'Aedahwa7', roles: [{role: 'readWrite', db: 'mydb'}]})
>>> exit
2016-02-02 09:15:48 +00:00
$ mongo mongodb://myuser:Aedahwa7@localhost:27017/mydb
2021-12-01 03:31:58 +00:00
>>> show collections
>>> exit
2016-02-02 09:15:48 +00:00
```
2016-02-02 16:10:22 +00:00
Read [this][2] and [this][3] for more help.
2016-02-02 09:15:48 +00:00
[1]: https://www.mongodb.org/
[2]: https://docs.mongodb.org/manual/tutorial/enable-authentication/
2016-02-02 16:10:22 +00:00
[3]: https://docs.mongodb.org/manual/reference/built-in-roles/