@@ -2116,6 +2116,8 @@ declare module 'mongoose' {
2116
2116
2117
2117
type QueryWithHelpers < ResultType , DocType , THelpers = { } , RawDocType = DocType > = Query < ResultType , DocType , THelpers , RawDocType > & THelpers ;
2118
2118
2119
+ type UnpackedIntersection < T , U > = T extends ( infer V ) [ ] ? ( V & U ) [ ] : T & U ;
2120
+
2119
2121
class Query < ResultType , DocType , THelpers = { } , RawDocType = DocType > {
2120
2122
_mongooseOptions : MongooseQueryOptions ;
2121
2123
@@ -2398,8 +2400,8 @@ declare module 'mongoose' {
2398
2400
polygon ( path : string , ...coordinatePairs : number [ ] [ ] ) : this;
2399
2401
2400
2402
/** Specifies paths which should be populated with other documents. */
2401
- populate < Paths = { } > ( path : string | any , select ?: string | any , model ?: string | Model < any , THelpers > , match ?: any ) : QueryWithHelpers < ResultType & Paths , DocType , THelpers , RawDocType > ;
2402
- populate < Paths = { } > ( options : PopulateOptions | Array < PopulateOptions > ) : QueryWithHelpers < ResultType & Paths , DocType , THelpers , RawDocType > ;
2403
+ populate < Paths = { } > ( path : string | any , select ?: string | any , model ?: string | Model < any , THelpers > , match ?: any ) : QueryWithHelpers < UnpackedIntersection < ResultType , Paths > , DocType , THelpers , RawDocType > ;
2404
+ populate < Paths = { } > ( options : PopulateOptions | Array < PopulateOptions > ) : QueryWithHelpers < UnpackedIntersection < ResultType , Paths > , DocType , THelpers , RawDocType > ;
2403
2405
2404
2406
/** Get/set the current projection (AKA fields). Pass `null` to remove the current projection. */
2405
2407
projection ( fields ?: any | null ) : any ;
0 commit comments