Skip to content

Commit

Permalink
types(populate): more graceful handling of query populate() without…
Browse files Browse the repository at this point in the history
… generics re: #14525
  • Loading branch information
vkarpov15 committed Apr 23, 2024
1 parent a68cc5c commit fe1ed86
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions types/query.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,28 @@ declare module 'mongoose' {
polygon(...coordinatePairs: number[][]): this;

/** Specifies paths which should be populated with other documents. */
populate<Paths = {}>(
populate(
path: string | string[],
select?: string | any,
model?: string | Model<any, THelpers>,
match?: any
): QueryWithHelpers<
ResultType,
DocType,
THelpers,
RawDocType,
QueryOp
>;
populate(
options: PopulateOptions | (PopulateOptions | string)[]
): QueryWithHelpers<
ResultType,
DocType,
THelpers,
RawDocType,
QueryOp
>;
populate<Paths>(
path: string | string[],
select?: string | any,
model?: string | Model<any, THelpers>,
Expand All @@ -626,7 +647,7 @@ declare module 'mongoose' {
UnpackedIntersection<RawDocType, Paths>,
QueryOp
>;
populate<Paths = {}>(
populate<Paths>(
options: PopulateOptions | (PopulateOptions | string)[]
): QueryWithHelpers<
MergePopulatePaths<RawDocType, ResultType, QueryOp, Paths, THelpers>,
Expand Down

0 comments on commit fe1ed86

Please sign in to comment.