@@ -592,6 +592,17 @@ declare module 'mongoose' {
592
592
) : QueryWithHelpers < ResultDoc | null , ResultDoc , TQueryHelpers , TRawDocType , 'findOneAndDelete' > ;
593
593
594
594
/** 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
+ > ;
595
606
findByIdAndUpdate < ResultDoc = THydratedDocumentType > (
596
607
id : mongodb . ObjectId | any ,
597
608
update : UpdateQuery < TRawDocType > ,
@@ -675,9 +686,9 @@ declare module 'mongoose' {
675
686
findOneAndUpdate < ResultDoc = THydratedDocumentType > (
676
687
filter : FilterQuery < TRawDocType > ,
677
688
update : UpdateQuery < TRawDocType > ,
678
- options : QueryOptions < TRawDocType > & { lean : true }
689
+ options : QueryOptions < TRawDocType > & { includeResultMetadata : true , lean : true }
679
690
) : QueryWithHelpers <
680
- GetLeanResultType < TRawDocType , TRawDocType , 'findOneAndUpdate' > | null ,
691
+ ModifyResult < TRawDocType > ,
681
692
ResultDoc ,
682
693
TQueryHelpers ,
683
694
TRawDocType ,
@@ -686,8 +697,14 @@ declare module 'mongoose' {
686
697
findOneAndUpdate < ResultDoc = THydratedDocumentType > (
687
698
filter : FilterQuery < TRawDocType > ,
688
699
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
+ > ;
691
708
findOneAndUpdate < ResultDoc = THydratedDocumentType > (
692
709
filter : FilterQuery < TRawDocType > ,
693
710
update : UpdateQuery < TRawDocType > ,
0 commit comments