Skip to content

Commit

Permalink
fix(types/query): bring "getFilter" and "getQuery" in-line with "find…
Browse files Browse the repository at this point in the history
…" and other types

change "DocType" -> "RawDocType"
  • Loading branch information
hasezoey committed Mar 23, 2024
1 parent 7f2c56c commit 0d20b1d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions types/query.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ declare module 'mongoose' {
get(path: string): any;

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

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

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

/** Returns the current update operations as a JSON object. */
getUpdate(): UpdateQuery<DocType> | UpdateWithAggregationPipeline | null;
Expand Down
2 changes: 1 addition & 1 deletion types/schemaoptions.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ declare module 'mongoose' {
query?: IfEquals<
QueryHelpers,
{},
Record<any, <T extends QueryWithHelpers<unknown, THydratedDocumentType>>(this: T, ...args: any) => T>,
Record<any, <T extends QueryWithHelpers<unknown, THydratedDocumentType, QueryHelpers, DocType>>(this: T, ...args: any) => T>,
QueryHelpers
>

Expand Down

0 comments on commit 0d20b1d

Please sign in to comment.