Skip to content

Commit cfb2785

Browse files
committed
fix(types): avoid typeof Query with generics for TypeScript 4.6 support
Fix #12688
1 parent 15c0068 commit cfb2785

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

types/query.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ declare module 'mongoose' {
616616
then: Promise<ResultType>['then'];
617617

618618
/** Converts this query to a customized, reusable query constructor with all arguments and options retained. */
619-
toConstructor(): typeof Query<ResultType, DocType, THelpers, RawDocType>;
619+
toConstructor<RetType = typeof Query>(): RetType;
620620

621621
/** Declare and/or execute this query as an update() operation. */
622622
update(filter?: FilterQuery<DocType>, update?: UpdateQuery<DocType> | UpdateWithAggregationPipeline, options?: QueryOptions<DocType> | null, callback?: Callback<UpdateWriteOpResult>): QueryWithHelpers<UpdateWriteOpResult, DocType, THelpers, RawDocType>;

0 commit comments

Comments
 (0)