Skip to content

Commit 3a397c6

Browse files
committed
docs(mongo): change the way to define the mongoose document interface
Mongoose introduced `HydratedDocument` from 6.0.13. refs: https://github.com/Automattic/mongoose/blob/6.7.0/docs/typescript.md#creating-your-first-document Automattic/mongoose@8120c8f
1 parent 0d16089 commit 3a397c6

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
@@ -34,9 +34,9 @@ Let's define the `CatSchema`:
3434
```typescript
3535
@@filename(schemas/cat.schema)
3636
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
37-
import { Document } from 'mongoose';
37+
import { HydratedDocument } from 'mongoose';
3838

39-
export type CatDocument = Cat & Document;
39+
export type CatDocument = HydratedDocument<Cat>;
4040

4141
@Schema()
4242
export class Cat {

0 commit comments

Comments
 (0)