Skip to content

Commit f491873

Browse files
authored
Mongodb config uses "useString" method from configService
I guess "useString" method existed before but it doesn't anymore. The async configuration section in mongo still uses it tough.
1 parent c299c1a commit f491873

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)