Skip to content

Commit

Permalink
Merge pull request #1122 from abt0/typeorm-mongodb-dsn-fix
Browse files Browse the repository at this point in the history
Fix connection URL for MongoDB in TypeORM
  • Loading branch information
BrunnerLivio authored Mar 27, 2021
2 parents f842fa4 + f5ee2c2 commit 5c0f4b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/health-indicator/database/typeorm.health.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class TypeOrmHealthIndicator extends HealthIndicator {
const driver = connection.driver as any;
// Hacky workaround which uses the native MongoClient
driver.mongodb.MongoClient.connect(
driver.buildConnectionUrl(connection.options),
connection.options.url ? connection.options.url : driver.buildConnectionUrl(connection.options),
driver.buildConnectionOptions(connection.options),
(err: Error, client: any) => {
if (err) return reject(new MongoConnectionError(err.message));
Expand Down

0 comments on commit 5c0f4b3

Please sign in to comment.