Skip to content

Commit fe1ed86

Browse files
committed
types(populate): more graceful handling of query populate() without generics re: #14525
1 parent a68cc5c commit fe1ed86

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

types/query.d.ts

+23-2
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,28 @@ declare module 'mongoose' {
614614
polygon(...coordinatePairs: number[][]): this;
615615

616616
/** Specifies paths which should be populated with other documents. */
617-
populate<Paths = {}>(
617+
populate(
618+
path: string | string[],
619+
select?: string | any,
620+
model?: string | Model<any, THelpers>,
621+
match?: any
622+
): QueryWithHelpers<
623+
ResultType,
624+
DocType,
625+
THelpers,
626+
RawDocType,
627+
QueryOp
628+
>;
629+
populate(
630+
options: PopulateOptions | (PopulateOptions | string)[]
631+
): QueryWithHelpers<
632+
ResultType,
633+
DocType,
634+
THelpers,
635+
RawDocType,
636+
QueryOp
637+
>;
638+
populate<Paths>(
618639
path: string | string[],
619640
select?: string | any,
620641
model?: string | Model<any, THelpers>,
@@ -626,7 +647,7 @@ declare module 'mongoose' {
626647
UnpackedIntersection<RawDocType, Paths>,
627648
QueryOp
628649
>;
629-
populate<Paths = {}>(
650+
populate<Paths>(
630651
options: PopulateOptions | (PopulateOptions | string)[]
631652
): QueryWithHelpers<
632653
MergePopulatePaths<RawDocType, ResultType, QueryOp, Paths, THelpers>,

0 commit comments

Comments
 (0)