diff options
Diffstat (limited to 'data/init-mongodb.js')
-rw-r--r-- | data/init-mongodb.js | 30 |
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() |