Skip to content

Commit

Permalink
Refactor doc.populate FN to make it accept any Model type.
Browse files Browse the repository at this point in the history
  • Loading branch information
mohammad0-0ahmad committed Apr 22, 2022
1 parent 12f8a20 commit eb84d41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/document.d.ts
Expand Up @@ -188,8 +188,8 @@ declare module 'mongoose' {
/** Populates document references. */
populate<Paths = {}>(path: string | PopulateOptions | (string | PopulateOptions)[]): Promise<this & Paths>;
populate<Paths = {}>(path: string | PopulateOptions | (string | PopulateOptions)[], callback: Callback<this & Paths>): void;
populate<Paths = {}>(path: string, select?: string | AnyObject, model?: Model<unknown>, match?: AnyObject, options?: PopulateOptions): Promise<this & Paths>;
populate<Paths = {}>(path: string, select?: string | AnyObject, model?: Model<unknown>, match?: AnyObject, options?: PopulateOptions, callback?: Callback<this & Paths>): void;
populate<Paths = {}>(path: string, select?: string | AnyObject, model?: Model<any>, match?: AnyObject, options?: PopulateOptions): Promise<this & Paths>;
populate<Paths = {}>(path: string, select?: string | AnyObject, model?: Model<any>, match?: AnyObject, options?: PopulateOptions, callback?: Callback<this & Paths>): void;

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

0 comments on commit eb84d41

Please sign in to comment.