Skip to content

Commit eda5634

Browse files
committed
Trying mongoose connection string parameters
1 parent db81d7d commit eda5634

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ app.use((req, res, next) => {
4949
// Connect to MongoDB database
5050
const dbConnectionStr = dbUtils.getMongoConnectionString()
5151
mongoose.connect(dbConnectionStr, {
52-
useNewUrlParser: true,
53-
useUnifiedTopology: true
52+
authMechanism: 'SCRAM-SHA-1',
53+
tls: false
5454
})
5555

5656
// database connection

src/utils/db.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function getMongoConnectionString () {
2727
logger.info('Using dbName = ' + config.get(`${appEnv}.database`))
2828
logger.info(`Will try to connect to database ${dbName} at ${dbHost}:${dbPort}`)
2929

30-
return `mongodb://${dbLoginPrepend}${dbHost}:${dbPort}/${dbName}?authMechanism=SCRAM-SHA-1`
30+
return `mongodb://${dbLoginPrepend}${dbHost}:${dbPort}/${dbName}`
3131
}
3232

3333
module.exports = {

0 commit comments

Comments
 (0)