Skip to content

Commit 7efa151

Browse files
authored
Merge pull request #13992 from suzuki/fix/doc-typescript-query-helper
fix(document): fix missing import and change wrong variable name
2 parents 8831f03 + eacb5ab commit 7efa151

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/typescript/query-helpers.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ The 2nd generic parameter, `TQueryHelpers`, should be an interface that contains
2929
Below is an example of creating a `ProjectModel` with a `byName` query helper.
3030

3131
```typescript
32-
import { HydratedDocument, Model, Query, Schema, model } from 'mongoose';
32+
import { HydratedDocument, Model, QueryWithHelpers, Schema, model, connect } from 'mongoose';
3333

3434
interface Project {
3535
name?: string;
@@ -64,7 +64,7 @@ ProjectSchema.query.byName = function byName(
6464
};
6565

6666
// 2nd param to `model()` is the Model class to return.
67-
const ProjectModel = model<Project, ProjectModelType>('Project', schema);
67+
const ProjectModel = model<Project, ProjectModelType>('Project', ProjectSchema);
6868

6969
run().catch(err => console.log(err));
7070

0 commit comments

Comments
 (0)