Skip to content

Commit ef4cb63

Browse files
authored
Merge pull request #14463 from hasezoey/fixQuery
fix(types/query): bring "getFilter" and "getQuery" in-line with "find" and other types
2 parents f3a094f + 0d20b1d commit ef4cb63

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

types/query.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ declare module 'mongoose' {
493493
get(path: string): any;
494494

495495
/** Returns the current query filter (also known as conditions) as a POJO. */
496-
getFilter(): FilterQuery<DocType>;
496+
getFilter(): FilterQuery<RawDocType>;
497497

498498
/** Gets query options. */
499499
getOptions(): QueryOptions<DocType>;
@@ -502,7 +502,7 @@ declare module 'mongoose' {
502502
getPopulatedPaths(): Array<string>;
503503

504504
/** Returns the current query filter. Equivalent to `getFilter()`. */
505-
getQuery(): FilterQuery<DocType>;
505+
getQuery(): FilterQuery<RawDocType>;
506506

507507
/** Returns the current update operations as a JSON object. */
508508
getUpdate(): UpdateQuery<DocType> | UpdateWithAggregationPipeline | null;

types/schemaoptions.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ declare module 'mongoose' {
234234
query?: IfEquals<
235235
QueryHelpers,
236236
{},
237-
Record<any, <T extends QueryWithHelpers<unknown, THydratedDocumentType>>(this: T, ...args: any) => T>,
237+
Record<any, <T extends QueryWithHelpers<unknown, THydratedDocumentType, QueryHelpers, DocType>>(this: T, ...args: any) => T>,
238238
QueryHelpers
239239
>
240240

0 commit comments

Comments
 (0)