Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types/query): bring "getFilter" and "getQuery" in-line with "find" and other types #14463

Merged
merged 1 commit into from Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions types/query.d.ts
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
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