@@ -634,30 +634,30 @@ describe('CRUD API', function () {
634
634
await collection . drop ( ) ;
635
635
} ) ;
636
636
637
- context ( 'when returnRawResult is false ' , function ( ) {
637
+ context ( 'when includeResultMetadata is true ' , function ( ) {
638
638
beforeEach ( async function ( ) {
639
639
await collection . insertMany ( [ { a : 1 , b : 1 } ] , { writeConcern : { w : 1 } } ) ;
640
640
} ) ;
641
641
642
642
it ( 'returns the modify result' , async function ( ) {
643
643
const result = await collection . findOneAndDelete (
644
644
{ a : 1 } ,
645
- { projection : { b : 1 } , sort : { a : 1 } , returnRawResult : false }
645
+ { projection : { b : 1 } , sort : { a : 1 } }
646
646
) ;
647
647
expect ( result ?. lastErrorObject . n ) . to . equal ( 1 ) ;
648
648
expect ( result ?. value . b ) . to . equal ( 1 ) ;
649
649
} ) ;
650
650
} ) ;
651
651
652
- context ( 'when returnRawResult is true ' , function ( ) {
652
+ context ( 'when includeResultMetadata is false ' , function ( ) {
653
653
beforeEach ( async function ( ) {
654
654
await collection . insertMany ( [ { a : 1 , b : 1 } ] , { writeConcern : { w : 1 } } ) ;
655
655
} ) ;
656
656
657
657
it ( 'returns the deleted document' , async function ( ) {
658
658
const result = await collection . findOneAndDelete (
659
659
{ a : 1 } ,
660
- { projection : { b : 1 } , sort : { a : 1 } }
660
+ { projection : { b : 1 } , sort : { a : 1 } , includeResultMetadata : false }
661
661
) ;
662
662
expect ( result ?. b ) . to . equal ( 1 ) ;
663
663
} ) ;
@@ -681,7 +681,7 @@ describe('CRUD API', function () {
681
681
await collection . drop ( ) ;
682
682
} ) ;
683
683
684
- context ( 'when returnRawResult is false ' , function ( ) {
684
+ context ( 'when includeResultMetadata is true ' , function ( ) {
685
685
beforeEach ( async function ( ) {
686
686
await collection . insertMany ( [ { a : 1 , b : 1 } ] , { writeConcern : { w : 1 } } ) ;
687
687
} ) ;
@@ -694,8 +694,7 @@ describe('CRUD API', function () {
694
694
projection : { b : 1 , c : 1 } ,
695
695
sort : { a : 1 } ,
696
696
returnDocument : ReturnDocument . AFTER ,
697
- upsert : true ,
698
- returnRawResult : false
697
+ upsert : true
699
698
}
700
699
) ;
701
700
expect ( result ?. lastErrorObject . n ) . to . equal ( 1 ) ;
@@ -704,7 +703,7 @@ describe('CRUD API', function () {
704
703
} ) ;
705
704
} ) ;
706
705
707
- context ( 'when returnRawResult is true ' , function ( ) {
706
+ context ( 'when includeResultMetadata is false ' , function ( ) {
708
707
beforeEach ( async function ( ) {
709
708
await collection . insertMany ( [ { a : 1 , b : 1 } ] , { writeConcern : { w : 1 } } ) ;
710
709
} ) ;
@@ -717,7 +716,8 @@ describe('CRUD API', function () {
717
716
projection : { b : 1 , c : 1 } ,
718
717
sort : { a : 1 } ,
719
718
returnDocument : ReturnDocument . AFTER ,
720
- upsert : true
719
+ upsert : true ,
720
+ includeResultMetadata : false
721
721
}
722
722
) ;
723
723
expect ( result ?. b ) . to . equal ( 1 ) ;
@@ -743,7 +743,7 @@ describe('CRUD API', function () {
743
743
await collection . drop ( ) ;
744
744
} ) ;
745
745
746
- context ( 'when returnRawResult is false ' , function ( ) {
746
+ context ( 'when includeResultMetadata is true ' , function ( ) {
747
747
beforeEach ( async function ( ) {
748
748
await collection . insertMany ( [ { a : 1 , b : 1 } ] , { writeConcern : { w : 1 } } ) ;
749
749
} ) ;
@@ -756,8 +756,7 @@ describe('CRUD API', function () {
756
756
projection : { b : 1 , d : 1 } ,
757
757
sort : { a : 1 } ,
758
758
returnDocument : ReturnDocument . AFTER ,
759
- upsert : true ,
760
- returnRawResult : false
759
+ upsert : true
761
760
}
762
761
) ;
763
762
expect ( result ?. lastErrorObject . n ) . to . equal ( 1 ) ;
@@ -766,7 +765,7 @@ describe('CRUD API', function () {
766
765
} ) ;
767
766
} ) ;
768
767
769
- context ( 'when returnRawResult is true ' , function ( ) {
768
+ context ( 'when includeResultMetadata is false ' , function ( ) {
770
769
beforeEach ( async function ( ) {
771
770
await collection . insertMany ( [ { a : 1 , b : 1 } ] , { writeConcern : { w : 1 } } ) ;
772
771
} ) ;
@@ -779,7 +778,8 @@ describe('CRUD API', function () {
779
778
projection : { b : 1 , d : 1 } ,
780
779
sort : { a : 1 } ,
781
780
returnDocument : ReturnDocument . AFTER ,
782
- upsert : true
781
+ upsert : true ,
782
+ includeResultMetadata : false
783
783
}
784
784
) ;
785
785
expect ( result ?. b ) . to . equal ( 1 ) ;
0 commit comments