From ce4af3f21ce6c628024f33e4ba53f756700242bd Mon Sep 17 00:00:00 2001 From: Asdullah Siddique <34271231+asdullahsiddique@users.noreply.github.com> Date: Mon, 10 Jun 2019 20:21:58 +0200 Subject: [PATCH] mongoose: model.discriminator() to accept both document and model interface (#35944) --- types/mongoose/index.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 1701898561..c9f09c1522 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -2923,6 +2923,13 @@ declare module "mongoose" { */ discriminator(name: string, schema: Schema): Model; + /** + * Adds a discriminator type. + * @param name discriminator model name + * @param schema discriminator model schema + */ + discriminator>(name: string, schema: Schema): M; + /** Creates a Query for a distinct operation. Passing a callback immediately executes the query. */ distinct(field: string, callback?: (err: any, res: any[]) => void): Query & QueryHelpers; distinct(field: string, conditions: any,