Skip to content

Commit 1c2d602

Browse files
authored
Added pre and post function types on Query class
1 parent 3ba9778 commit 1c2d602

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

types/query.d.ts

Lines changed: 6 additions & 0 deletions
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)