From eacb5ab893d0218eddd64f7515431d07a903d7f5 Mon Sep 17 00:00:00 2001 From: Norio Suzuki Date: Wed, 18 Oct 2023 07:32:58 +0900 Subject: [PATCH] fix(document): fix missing import and change wrong variable name --- docs/typescript/query-helpers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/typescript/query-helpers.md b/docs/typescript/query-helpers.md index 163fe90d36c..0f1c67a5483 100644 --- a/docs/typescript/query-helpers.md +++ b/docs/typescript/query-helpers.md @@ -29,7 +29,7 @@ The 2nd generic parameter, `TQueryHelpers`, should be an interface that contains Below is an example of creating a `ProjectModel` with a `byName` query helper. ```typescript -import { HydratedDocument, Model, Query, Schema, model } from 'mongoose'; +import { HydratedDocument, Model, QueryWithHelpers, Schema, model, connect } from 'mongoose'; interface Project { name?: string; @@ -64,7 +64,7 @@ ProjectSchema.query.byName = function byName( }; // 2nd param to `model()` is the Model class to return. -const ProjectModel = model('Project', schema); +const ProjectModel = model('Project', ProjectSchema); run().catch(err => console.log(err));