From cfb2785a975bc24eb88f01883605380e365eafc3 Mon Sep 17 00:00:00 2001 From: Valeri Karpov Date: Mon, 21 Nov 2022 10:03:02 -0800 Subject: [PATCH] fix(types): avoid typeof Query with generics for TypeScript 4.6 support Fix #12688 --- types/query.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/query.d.ts b/types/query.d.ts index 3a3a7a6b36f..5dec26efd7a 100644 --- a/types/query.d.ts +++ b/types/query.d.ts @@ -616,7 +616,7 @@ declare module 'mongoose' { then: Promise['then']; /** Converts this query to a customized, reusable query constructor with all arguments and options retained. */ - toConstructor(): typeof Query; + toConstructor(): RetType; /** Declare and/or execute this query as an update() operation. */ update(filter?: FilterQuery, update?: UpdateQuery | UpdateWithAggregationPipeline, options?: QueryOptions | null, callback?: Callback): QueryWithHelpers;