@@ -592,6 +592,17 @@ declare module 'mongoose' {
592592 ) : QueryWithHelpers < ResultDoc | null , ResultDoc , TQueryHelpers , TRawDocType , 'findOneAndDelete' > ;
593593
594594 /** Creates a `findOneAndUpdate` query, filtering by the given `_id`. */
595+ findByIdAndUpdate < ResultDoc = THydratedDocumentType > (
596+ filter : FilterQuery < TRawDocType > ,
597+ update : UpdateQuery < TRawDocType > ,
598+ options : QueryOptions < TRawDocType > & { includeResultMetadata : true , lean : true }
599+ ) : QueryWithHelpers <
600+ ModifyResult < TRawDocType > ,
601+ ResultDoc ,
602+ TQueryHelpers ,
603+ TRawDocType ,
604+ 'findOneAndUpdate'
605+ > ;
595606 findByIdAndUpdate < ResultDoc = THydratedDocumentType > (
596607 id : mongodb . ObjectId | any ,
597608 update : UpdateQuery < TRawDocType > ,
@@ -675,9 +686,9 @@ declare module 'mongoose' {
675686 findOneAndUpdate < ResultDoc = THydratedDocumentType > (
676687 filter : FilterQuery < TRawDocType > ,
677688 update : UpdateQuery < TRawDocType > ,
678- options : QueryOptions < TRawDocType > & { lean : true }
689+ options : QueryOptions < TRawDocType > & { includeResultMetadata : true , lean : true }
679690 ) : QueryWithHelpers <
680- GetLeanResultType < TRawDocType , TRawDocType , 'findOneAndUpdate' > | null ,
691+ ModifyResult < TRawDocType > ,
681692 ResultDoc ,
682693 TQueryHelpers ,
683694 TRawDocType ,
@@ -686,8 +697,14 @@ declare module 'mongoose' {
686697 findOneAndUpdate < ResultDoc = THydratedDocumentType > (
687698 filter : FilterQuery < TRawDocType > ,
688699 update : UpdateQuery < TRawDocType > ,
689- options : QueryOptions < TRawDocType > & { includeResultMetadata : true }
690- ) : QueryWithHelpers < ModifyResult < ResultDoc > , ResultDoc , TQueryHelpers , TRawDocType , 'findOneAndUpdate' > ;
700+ options : QueryOptions < TRawDocType > & { lean : true }
701+ ) : QueryWithHelpers <
702+ GetLeanResultType < TRawDocType , TRawDocType , 'findOneAndUpdate' > | null ,
703+ ResultDoc ,
704+ TQueryHelpers ,
705+ TRawDocType ,
706+ 'findOneAndUpdate'
707+ > ;
691708 findOneAndUpdate < ResultDoc = THydratedDocumentType > (
692709 filter : FilterQuery < TRawDocType > ,
693710 update : UpdateQuery < TRawDocType > ,
0 commit comments