Skip to content

Commit

Permalink
Fix connection URL for MongoDB in TypeORM
Browse files Browse the repository at this point in the history
  • Loading branch information
abt0 committed Mar 23, 2021
1 parent b1cdc6b commit f5ee2c2
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 f5ee2c2

Please sign in to comment.