From 3a397c6f09a86fe74fc763857ba25ab29215ed64 Mon Sep 17 00:00:00 2001 From: Jinwoo Oh Date: Tue, 1 Nov 2022 22:41:44 -0700 Subject: [PATCH] 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 https://github.com/Automattic/mongoose/commit/8120c8f6d73f48c9a4cf5821ede8f6d96da74ec8 --- content/techniques/mongo.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/content/techniques/mongo.md b/content/techniques/mongo.md index a44f4090cb..586fd6bc18 100644 --- a/content/techniques/mongo.md +++ b/content/techniques/mongo.md @@ -34,9 +34,9 @@ Let's define the `CatSchema`: ```typescript @@filename(schemas/cat.schema) import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'; -import { Document } from 'mongoose'; +import { HydratedDocument } from 'mongoose'; -export type CatDocument = Cat & Document; +export type CatDocument = HydratedDocument; @Schema() export class Cat {