Closed aljones15 closed 4 years ago
Related to config options below, we just use config.mongodb.username and config.username.password? That is, can we just populate auth
with the existing config stuff?
// this is new and should be user over username and password
connectOptions.auth = { user: process.env.mongo_user, password: process.env.mongo_password },
Related to config options below, we just use config.mongodb.username and config.username.password? That is, can we just populate
auth
with the existing config stuff?// this is new and should be user over username and password connectOptions.auth = { user: process.env.mongo_user, password: process.env.mongo_password },
resolved here: https://github.com/digitalbazaar/bedrock-mongodb/pull/44/commits/3ef62964e33e0b405db522a6d19925c0faf96ab1
This did cause the tests to fail in CI, but I issued another update that fixed that.
NOTE:
this branch now sets connectOptions.auth if username and password are set.
This updates the README so that it is easier to navigate the options necessary to connect to acces-enabled mongo dbs with replica sets. There are still code changes that would make this process easier, but for the moment this should cover it:
You can also connect to access-enabled mongo servers using some small changes to the
config.mongodb.connectOptions
:We need to update the config.js to better reflect the options that mongo 4.2 uses as username and password have been deprecated and setting them throws a warning.
@gannan08 if you want to add you url code to this PR it is 100% welcome and would be great.