Skip to content

Commit 5fca922

Browse files
authored
Merge pull request #14433 from IICarst/query-middleware-types-fix
Added pre and post function types on Query class
2 parents 1aa88a3 + 1c2d602 commit 5fca922

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

types/query.d.ts

+6
Original file line numberDiff line numberDiff line change
@@ -627,6 +627,12 @@ declare module 'mongoose' {
627627
QueryOp
628628
>;
629629

630+
/** Add pre middleware to this query instance. Doesn't affect other queries. */
631+
pre(fn: Function): this;
632+
633+
/** Add post middleware to this query instance. Doesn't affect other queries. */
634+
post(fn: Function): this;
635+
630636
/** Get/set the current projection (AKA fields). Pass `null` to remove the current projection. */
631637
projection(fields?: ProjectionFields<DocType> | string): ProjectionFields<DocType>;
632638
projection(fields: null): null;

0 commit comments

Comments
 (0)