Skip to content

Commit

Permalink
fix(mongoose): Fix default connection string
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunnerLivio committed Apr 22, 2019
1 parent e92af60 commit 4d188b4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions lib/health-indicators/database/mongoose.health.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,15 @@ export class MongooseHealthIndicator extends HealthIndicator {
private getContextConnection(): Connection {
const {
getConnectionToken,
} = require('@nestjs/mongoose/dist/common/mongoose.utils') as typeof NestJSMongoose;
} = require('@nestjs/mongoose') as typeof NestJSMongoose;

try {
return this.moduleRef.get(getConnectionToken() as string, {
strict: false,
});
return this.moduleRef.get(
getConnectionToken('DatabaseConnection') as string,
{
strict: false,
},
);
} catch (err) {
return null;
}
Expand Down
2 changes: 1 addition & 1 deletion sample/000-dogs-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"test:watch": "jest --watch",
"test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json"$
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@godaddy/terminus": "4.1.0",
Expand Down

0 comments on commit 4d188b4

Please sign in to comment.