summaryrefslogtreecommitdiff
path: root/data/init-mongodb.js
diff options
context:
space:
mode:
authorVictor Näslund <victor@sunet.se>2022-11-13 04:12:47 +0100
committerVictor Näslund <victor@sunet.se>2022-11-13 04:12:47 +0100
commitf7a40b9e13d242968db83acaac13660224eb0143 (patch)
treed8f0cdf5d93cc1aebc83343aea6615bc2ee9bc55 /data/init-mongodb.js
parent8baecf339e8061160bee519e87ffe837d1525c18 (diff)
new direction
Diffstat (limited to 'data/init-mongodb.js')
-rw-r--r--data/init-mongodb.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/data/init-mongodb.js b/data/init-mongodb.js
new file mode 100644
index 0000000..4b64674
--- /dev/null
+++ b/data/init-mongodb.js
@@ -0,0 +1,30 @@
+
+// To help improve our products, anonymous usage data is collected and sent to MongoDB periodically (https://www.mongodb.com/legal/privacy-policy).
+// You can opt-out by running the disableTelemetry() command.
+disableTelemetry()
+
+// Create the DB by inserting some data
+db.v0.insertOne({init_key: "init_data"})
+
+// Create user
+db.createUser(
+ {
+ user: "REPLACE_USERNAME",
+ pwd: "REPLACE_PASSWORD",
+ roles: [
+ {
+ role: "readWrite",
+ db: "production"
+ }
+ ]
+ }
+)
+
+// Delete the init data
+db.v0.deleteOne({init_key: "init_data"})
+
+// Disable the ad about monitoring
+db.disableFreeMonitoring()
+
+// Restart server now
+db.shutdownServer()