From afca71ea172620485b380abe10db9f52a5db7d3c Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 21 Nov 2016 21:17:27 -0500 Subject: [PATCH] update mongoose deep populate options --- mongoose/index.d.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mongoose/index.d.ts b/mongoose/index.d.ts index 3dc0b0d0b0..f862d3b3d1 100644 --- a/mongoose/index.d.ts +++ b/mongoose/index.d.ts @@ -813,7 +813,7 @@ declare module "mongoose" { */ populate(callback: (err: any, res: this) => void): this; populate(path: string, callback?: (err: any, res: this) => void): this; - populate(options: ModelPopulateOptions, callback?: (err: any, res: this) => void): this; + populate(options: ModelPopulateOptions | ModelPopulateOptions[], callback?: (err: any, res: this) => void): this; /** Gets _id(s) used during population of the given path. If the path was not populated, undefined is returned. */ populated(path: string): any; @@ -1454,7 +1454,7 @@ declare module "mongoose" { */ populate(path: string | Object, select?: string | Object, model?: any, match?: Object, options?: Object): this; - populate(options: ModelPopulateOptions): this; + populate(options: ModelPopulateOptions | ModelPopulateOptions[]): this; /** * Determines the MongoDB nodes from which to read. @@ -2428,6 +2428,8 @@ declare module "mongoose" { model?: string; /** optional query options like sort, limit, etc */ options?: Object; + /** deep populate */ + populate?: ModelPopulateOptions | ModelPopulateOptions[] } interface ModelUpdateOptions {