Skip to content

Commit

Permalink
Merge pull request #13992 from suzuki/fix/doc-typescript-query-helper
Browse files Browse the repository at this point in the history
fix(document): fix missing import and change wrong variable name
  • Loading branch information
vkarpov15 authored Oct 19, 2023
2 parents 8831f03 + eacb5ab commit 7efa151
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/typescript/query-helpers.md
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -64,7 +64,7 @@ ProjectSchema.query.byName = function byName(
};

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

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

Expand Down

0 comments on commit 7efa151

Please sign in to comment.