@@ -652,32 +652,37 @@ describe('Bulk', function () {
652
652
}
653
653
} ) ;
654
654
655
- it ( 'should correctly execute ordered batch using w:0' , function ( done ) {
656
- client . connect ( ( err , client ) => {
657
- const db = client . db ( ) ;
658
- const col = db . collection ( 'batch_write_ordered_ops_9' ) ;
655
+ it (
656
+ 'should correctly execute ordered batch using w:0' ,
657
+ // TODO(NODE-6060): set `moreToCome` op_msg bit when `w: 0` is specified
658
+ { requires : { mongodb : '<8.0.0' } } ,
659
+ function ( done ) {
660
+ client . connect ( ( err , client ) => {
661
+ const db = client . db ( ) ;
662
+ const col = db . collection ( 'batch_write_ordered_ops_9' ) ;
659
663
660
- const bulk = col . initializeOrderedBulkOp ( ) ;
661
- for ( let i = 0 ; i < 100 ; i ++ ) {
662
- bulk . insert ( { a : 1 } ) ;
663
- }
664
+ const bulk = col . initializeOrderedBulkOp ( ) ;
665
+ for ( let i = 0 ; i < 100 ; i ++ ) {
666
+ bulk . insert ( { a : 1 } ) ;
667
+ }
664
668
665
- bulk . find ( { b : 1 } ) . upsert ( ) . update ( { b : 1 } ) ;
666
- bulk . find ( { c : 1 } ) . delete ( ) ;
669
+ bulk . find ( { b : 1 } ) . upsert ( ) . update ( { b : 1 } ) ;
670
+ bulk . find ( { c : 1 } ) . delete ( ) ;
667
671
668
- bulk . execute ( { writeConcern : { w : 0 } } , function ( err , result ) {
669
- expect ( err ) . to . not . exist ;
670
- test . equal ( 0 , result . upsertedCount ) ;
671
- test . equal ( 0 , result . insertedCount ) ;
672
- test . equal ( 0 , result . matchedCount ) ;
673
- test . ok ( 0 === result . modifiedCount || result . modifiedCount == null ) ;
674
- test . equal ( 0 , result . deletedCount ) ;
675
- test . equal ( false , result . hasWriteErrors ( ) ) ;
672
+ bulk . execute ( { writeConcern : { w : 0 } } , function ( err , result ) {
673
+ expect ( err ) . to . not . exist ;
674
+ test . equal ( 0 , result . upsertedCount ) ;
675
+ test . equal ( 0 , result . insertedCount ) ;
676
+ test . equal ( 0 , result . matchedCount ) ;
677
+ test . ok ( 0 === result . modifiedCount || result . modifiedCount == null ) ;
678
+ test . equal ( 0 , result . deletedCount ) ;
679
+ test . equal ( false , result . hasWriteErrors ( ) ) ;
676
680
677
- client . close ( done ) ;
681
+ client . close ( done ) ;
682
+ } ) ;
678
683
} ) ;
679
- } ) ;
680
- } ) ;
684
+ }
685
+ ) ;
681
686
682
687
it ( 'should correctly handle single unordered batch API' , function ( done ) {
683
688
client . connect ( ( err , client ) => {
0 commit comments