Skip to content

Commit 43e9949

Browse files
examples(@nestjs) update plain mongoose example
1 parent 7446873 commit 43e9949

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

examples/06-mongoose/src/database/database.providers.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ import * as mongoose from 'mongoose';
33
export const databaseProviders = [
44
{
55
provide: 'DbConnectionToken',
6-
useFactory: async (): Promise<mongoose.Connection> => {
7-
(mongoose as any).Promise = global.Promise;
8-
return await mongoose.connect('mongodb://localhost/nest', {
9-
useMongoClient: true,
10-
});
11-
},
6+
useFactory: async (): Promise<mongoose.Connection> =>
7+
await mongoose.connect('mongodb://localhost/nest'),
128
},
139
];

0 commit comments

Comments
 (0)