Skip to content

Commit

Permalink
Merge pull request #14433 from IICarst/query-middleware-types-fix
Browse files Browse the repository at this point in the history
Added pre and post function types on Query class
  • Loading branch information
vkarpov15 committed Mar 14, 2024
2 parents 1aa88a3 + 1c2d602 commit 5fca922
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions types/query.d.ts
Expand Up @@ -627,6 +627,12 @@ declare module 'mongoose' {
QueryOp
>;

/** Add pre middleware to this query instance. Doesn't affect other queries. */
pre(fn: Function): this;

/** Add post middleware to this query instance. Doesn't affect other queries. */
post(fn: Function): this;

/** Get/set the current projection (AKA fields). Pass `null` to remove the current projection. */
projection(fields?: ProjectionFields<DocType> | string): ProjectionFields<DocType>;
projection(fields: null): null;
Expand Down

0 comments on commit 5fca922

Please sign in to comment.