From 4de9f521d94f4a1de33b43654b38f58ebe0ca7f5 Mon Sep 17 00:00:00 2001 From: steven Date: Fri, 16 Jun 2017 10:54:05 -0700 Subject: [PATCH 1/2] findOneAndUpdate: Add new parameter to callback --- types/mongoose/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index ac92a9cd74..9eac0f33a0 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -1498,11 +1498,11 @@ declare module "mongoose" { */ findOneAndUpdate(callback?: (err: any, doc: DocType | null) => void): DocumentQuery; findOneAndUpdate(update: Object, - callback?: (err: any, doc: DocType | null) => void): DocumentQuery; + callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery; findOneAndUpdate(query: Object | Query, update: Object, - callback?: (err: any, doc: DocType | null) => void): DocumentQuery; + callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery; findOneAndUpdate(query: Object | Query, update: Object, options: QueryFindOneAndUpdateOptions, - callback?: (err: any, doc: DocType | null) => void): DocumentQuery; + callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery; /** * Specifies a $geometry condition. geometry() must come after either intersects() or within(). From d534d3a6220dede25a86029c93a81b6b11a8d2fe Mon Sep 17 00:00:00 2001 From: steven Date: Fri, 16 Jun 2017 15:50:07 -0700 Subject: [PATCH 2/2] Add callback param to Model's findOneAndUpdate method --- types/mongoose/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 9eac0f33a0..12da9c180b 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -2471,10 +2471,10 @@ declare module "mongoose" { */ findOneAndUpdate(): DocumentQuery; findOneAndUpdate(conditions: Object, update: Object, - callback?: (err: any, res: T | null) => void): DocumentQuery; + callback?: (err: any, doc: T | null, res: any) => void): DocumentQuery; findOneAndUpdate(conditions: Object, update: Object, options: ModelFindOneAndUpdateOptions, - callback?: (err: any, res: T | null) => void): DocumentQuery; + callback?: (err: any, doc: T | null, res: any) => void): DocumentQuery; /** * geoNear support for Mongoose