Skip to content

Commit eb84d41

Browse files
Refactor doc.populate FN to make it accept any Model type.
1 parent 12f8a20 commit eb84d41

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

types/document.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,8 @@ declare module 'mongoose' {
188188
/** Populates document references. */
189189
populate<Paths = {}>(path: string | PopulateOptions | (string | PopulateOptions)[]): Promise<this & Paths>;
190190
populate<Paths = {}>(path: string | PopulateOptions | (string | PopulateOptions)[], callback: Callback<this & Paths>): void;
191-
populate<Paths = {}>(path: string, select?: string | AnyObject, model?: Model<unknown>, match?: AnyObject, options?: PopulateOptions): Promise<this & Paths>;
192-
populate<Paths = {}>(path: string, select?: string | AnyObject, model?: Model<unknown>, match?: AnyObject, options?: PopulateOptions, callback?: Callback<this & Paths>): void;
191+
populate<Paths = {}>(path: string, select?: string | AnyObject, model?: Model<any>, match?: AnyObject, options?: PopulateOptions): Promise<this & Paths>;
192+
populate<Paths = {}>(path: string, select?: string | AnyObject, model?: Model<any>, match?: AnyObject, options?: PopulateOptions, callback?: Callback<this & Paths>): void;
193193

194194
/** Gets _id(s) used during population of the given `path`. If the path was not populated, returns `undefined`. */
195195
populated(path: string): any;

0 commit comments

Comments
 (0)