Add MONGODB_REPLICA_SET for mongodb addon

This can be useful for constructing the ?replSet= part of the URI.
replicaSet is used by the client to discover the secondaries and fallback
automatically. if not provided, they just talk to primary.
This commit is contained in:
Girish Ramakrishnan
2019-06-26 21:16:42 -07:00
parent ddf634bfb2
commit 5a000c1ff4
3 changed files with 4 additions and 2 deletions

View File

@@ -1455,7 +1455,8 @@ function setupMongoDb(app, options, callback) {
{ name: `${envPrefix}MONGODB_PASSWORD`, value: data.password },
{ name: `${envPrefix}MONGODB_HOST`, value : 'mongodb' },
{ name: `${envPrefix}MONGODB_PORT`, value : '27017' },
{ name: `${envPrefix}MONGODB_DATABASE`, value : data.database }
{ name: `${envPrefix}MONGODB_DATABASE`, value : data.database },
{ name: `${envPrefix}MONGODB_REPLICA_SET`, value : 'rs0' }, // only needed if client wants to use rs features
];
debugApp(app, 'Setting mongodb addon config to %j', env);