Skip to content

Commit cd8b986

Browse files
Merge pull request #1177 from AlexMenor/patch-1
Mongo async config section uses "useString" method from configService
2 parents c299c1a + f491873 commit cd8b986

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

content/techniques/mongo.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ Like other [factory providers](https://docs.nestjs.com/fundamentals/custom-provi
205205
const schema = CatsSchema;
206206
schema.pre('save', () =>
207207
console.log(
208-
`${configService.getString('APP_NAME')}: Hello from pre save`,
208+
`${configService.get<string>('APP_NAME')}: Hello from pre save`,
209209
),
210210
);
211211
return schema;
@@ -303,7 +303,7 @@ Like other [factory providers](https://docs.nestjs.com/fundamentals/custom-provi
303303
MongooseModule.forRootAsync({
304304
imports: [ConfigModule],
305305
useFactory: async (configService: ConfigService) => ({
306-
uri: configService.getString('MONGODB_URI'),
306+
uri: configService.get<string>('MONGODB_URI'),
307307
}),
308308
inject: [ConfigService],
309309
});

0 commit comments

Comments
 (0)