Skip to content

Commit

Permalink
Merge pull request #28 from linuxserver/readme-update
Browse files Browse the repository at this point in the history
Fix init permissions for older mongo versions
  • Loading branch information
drizuid authored Nov 7, 2023
2 parents e484a4b + efbe0c5 commit 0346eb3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion readme-vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ app_setup_block: |
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:
```js
db.getSiblingDB("MONGO_DBNAME").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "dbOwner", db: "MONGO_DBNAME"}, {role: "dbOwner", db: "MONGO_DBNAME_stat"}]});
db.getSiblingDB("MONGO_DBNAME").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "dbOwner", db: "MONGO_DBNAME"}]});
db.getSiblingDB("MONGO_DBNAME_stat").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "dbOwner", db: "MONGO_DBNAME_stat"}]});
```
Being sure to replace the placeholders with the same values you supplied to the Unifi container, and mount it into your *mongodb* container.
Expand Down

0 comments on commit 0346eb3

Please sign in to comment.