Skip to content

Commit ecc99af

Browse files
Bot Updating Templated Files
1 parent 8c66148 commit ecc99af

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,10 @@ Formally only mongodb 3.6 through 4.4 are supported, however, it has been report
6969

7070
**Make sure you pin your database image version and do not use `latest`, as mongodb does not support automatic upgrades between major versions.**
7171

72-
If you are using the [official mongodb container](https://hub.docker.com/_/mongo/), you can create your databases using an `init-mongo.js` file with the following contents:
72+
If you are using the [official mongodb container](https://hub.docker.com/_/mongo/), you can create your user using an `init-mongo.js` file with the following contents:
7373

7474
```js
75-
db.getSiblingDB("MONGO_DBNAME").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "readWrite", db: "MONGO_DBNAME"}]});
76-
db.getSiblingDB("MONGO_DBNAME_stat").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "readWrite", db: "MONGO_DBNAME_stat"}]});
75+
db.getSiblingDB("MONGO_DBNAME").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "dbOwner", db: "MONGO_DBNAME"}, {role: "dbOwner", db: "MONGO_DBNAME_stat"}]});
7776
```
7877

7978
Being sure to replace the placeholders with the same values you supplied to the Unifi container, and mount it into your *mongodb* container.

0 commit comments

Comments
 (0)