@@ -555,6 +555,18 @@ declare module 'mongoose' {
555
555
options ?: QueryOptions < TRawDocType > | null
556
556
) : QueryWithHelpers < ResultDoc | null , ResultDoc , TQueryHelpers , TRawDocType , 'findOneAndDelete' > ;
557
557
558
+ /** Creates a `findByIdAndRemove` query, filtering by the given `_id`. */
559
+ findByIdAndRemove < ResultDoc = THydratedDocumentType > (
560
+ id : mongodb . ObjectId | any ,
561
+ options : QueryOptions < TRawDocType > & { lean : true }
562
+ ) : QueryWithHelpers <
563
+ GetLeanResultType < TRawDocType , TRawDocType , 'findOneAndDelete' > | null ,
564
+ ResultDoc ,
565
+ TQueryHelpers ,
566
+ TRawDocType ,
567
+ 'findOneAndDelete'
568
+ > ;
569
+
558
570
/** Creates a `findOneAndUpdate` query, filtering by the given `_id`. */
559
571
findByIdAndUpdate < ResultDoc = THydratedDocumentType > (
560
572
id : mongodb . ObjectId | any ,
@@ -572,6 +584,11 @@ declare module 'mongoose' {
572
584
update : UpdateQuery < TRawDocType > ,
573
585
options : QueryOptions < TRawDocType > & { rawResult : true }
574
586
) : QueryWithHelpers < ModifyResult < ResultDoc > , ResultDoc , TQueryHelpers , TRawDocType , 'findOneAndUpdate' > ;
587
+ findByIdAndUpdate < ResultDoc = THydratedDocumentType > (
588
+ id : mongodb . ObjectId | any ,
589
+ update : UpdateQuery < TRawDocType > ,
590
+ options : QueryOptions < TRawDocType > & { includeResultMetadata : true }
591
+ ) : QueryWithHelpers < ModifyResult < ResultDoc > , ResultDoc , TQueryHelpers , TRawDocType , 'findOneAndUpdate' > ;
575
592
findByIdAndUpdate < ResultDoc = THydratedDocumentType > (
576
593
id : mongodb . ObjectId | any ,
577
594
update : UpdateQuery < TRawDocType > ,
@@ -630,6 +647,11 @@ declare module 'mongoose' {
630
647
replacement : TRawDocType | AnyObject ,
631
648
options : QueryOptions < TRawDocType > & { rawResult : true }
632
649
) : QueryWithHelpers < ModifyResult < ResultDoc > , ResultDoc , TQueryHelpers , TRawDocType , 'findOneAndReplace' > ;
650
+ findOneAndReplace < ResultDoc = THydratedDocumentType > (
651
+ filter : FilterQuery < TRawDocType > ,
652
+ replacement : TRawDocType | AnyObject ,
653
+ options : QueryOptions < TRawDocType > & { includeResultMetadata : true }
654
+ ) : QueryWithHelpers < ModifyResult < ResultDoc > , ResultDoc , TQueryHelpers , TRawDocType , 'findOneAndReplace' > ;
633
655
findOneAndReplace < ResultDoc = THydratedDocumentType > (
634
656
filter : FilterQuery < TRawDocType > ,
635
657
replacement : TRawDocType | AnyObject ,
0 commit comments