Skip to content

Commit efbe0c5

Browse files
committed
Fix init permissions for older mongo versions
1 parent e484a4b commit efbe0c5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

readme-vars.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ app_setup_block: |
6868
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:
6969
7070
```js
71-
db.getSiblingDB("MONGO_DBNAME").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "dbOwner", db: "MONGO_DBNAME"}, {role: "dbOwner", db: "MONGO_DBNAME_stat"}]});
71+
db.getSiblingDB("MONGO_DBNAME").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "dbOwner", db: "MONGO_DBNAME"}]});
72+
db.getSiblingDB("MONGO_DBNAME_stat").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "dbOwner", db: "MONGO_DBNAME_stat"}]});
7273
```
7374
7475
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)