From 5d4ea38d1e39be6186572b99f5ce8bc42743a169 Mon Sep 17 00:00:00 2001 From: Chris Lee Date: Tue, 26 Sep 2023 10:48:54 -0600 Subject: [PATCH] Update README.md mongo init instructions --- readme-vars.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/readme-vars.yml b/readme-vars.yml index 339d475..c26ae60 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -63,11 +63,10 @@ app_setup_block: | **Make sure you pin your database image version and do not use `latest`, as mongodb does not support automatic upgrades between major versions.** - 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: + 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: "readWrite", db: "MONGO_DBNAME"}]}); - db.getSiblingDB("MONGO_DBNAME_stat").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "readWrite", db: "MONGO_DBNAME_stat"}]}); + db.getSiblingDB("MONGO_DBNAME").createUser({user: "MONGO_USER", pwd: "MONGO_PASS", roles: [{role: "dbOwner", db: "MONGO_DBNAME"}, {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.