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 28, 2022
1 parent 87299af commit 9867f6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions types/document.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,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 9867f6d

Please sign in to comment.