diff --git a/src/server/database/MongoDB.js b/src/server/database/MongoDB.js index 3b77bf5..05c88df 100644 --- a/src/server/database/MongoDB.js +++ b/src/server/database/MongoDB.js @@ -40,7 +40,7 @@ class MongoDB { this.logger.warn(`No auth provided, proceeding without`); } - this.URI = `mongodb://${auth}${MONGO_HOST}:${MONGO_PORT}/${MONGO_DB}${AUTH_DB ? `?authSource=${AUTH_DB}` : ''}`; + this.URI = `mongodb://${auth}${MONGO_HOST}:${MONGO_PORT}/${AUTH_DB || ''}?readPreference=preferSecondary`; } this.client = new MongoClient(this.URI, this.config.options.client);