Skip to content

Commit

Permalink
@types/mongoose findOneAndUpdate promisification to allow await (ev…
Browse files Browse the repository at this point in the history
…en if it's not a fully-fledged promise)

See also Automattic/mongoose#7506
  • Loading branch information
JulioJu committed Feb 15, 2019
1 parent e9cb717 commit f3dfed9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions types/mongoose/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1914,12 +1914,14 @@ declare module "mongoose" {
callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery<DocType | null, DocType> & QueryHelpers;
findOneAndUpdate(query: any, update: any,
options: { rawResult: true } & { upsert: true } & { new: true } & QueryFindOneAndUpdateOptions,
callback?: (err: any, doc: mongodb.FindAndModifyWriteOpResultObject<DocType>, res: any) => void): mongodb.FindAndModifyWriteOpResultObject<DocType> & QueryHelpers;
callback?: (err: any, doc: mongodb.FindAndModifyWriteOpResultObject<DocType>, res: any) => void):
Promise<mongodb.FindAndModifyWriteOpResultObject<DocType>> & QueryHelpers;
findOneAndUpdate(query: any, update: any,
options: { upsert: true } & { new: true } & QueryFindOneAndUpdateOptions,
callback?: (err: any, doc: DocType, res: any) => void): DocumentQuery<DocType, DocType> & QueryHelpers;
findOneAndUpdate(query: any, update: any, options: { rawResult: true } & QueryFindOneAndUpdateOptions,
callback?: (err: any, doc: mongodb.FindAndModifyWriteOpResultObject<DocType | null>, res: any) => void): mongodb.FindAndModifyWriteOpResultObject<DocType | null> & QueryHelpers;
callback?: (err: any, doc: mongodb.FindAndModifyWriteOpResultObject<DocType | null>, res: any) => void):
Promise<mongodb.FindAndModifyWriteOpResultObject<DocType | null>> & QueryHelpers;
findOneAndUpdate(query: any, update: any, options: QueryFindOneAndUpdateOptions,
callback?: (err: any, doc: DocType | null, res: any) => void): DocumentQuery<DocType | null, DocType> & QueryHelpers;

Expand Down

0 comments on commit f3dfed9

Please sign in to comment.