mongo connection uri

This commit is contained in:
Erik 2023-02-06 19:27:19 +02:00
parent 78d9ac4b74
commit acfd9cf37f
Signed by: Navy.gif
GPG Key ID: 2532FBBB61C65A68

View File

@ -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);