// Create the DB by inserting some data db.REPLACE_COLLECTION.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.REPLACE_COLLECTION.deleteOne({init_key: "init_data"}) // Add healthcheck db.healthcheck.insertOne({healthcheck: "ok"}) // Disable the ad about monitoring db.disableFreeMonitoring() // Restart server now db.shutdownServer()