From f7a40b9e13d242968db83acaac13660224eb0143 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Victor=20N=C3=A4slund?= Date: Sun, 13 Nov 2022 04:12:47 +0100 Subject: new direction --- data/init-mongodb.js | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 data/init-mongodb.js (limited to 'data/init-mongodb.js') 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() -- cgit v1.1