@@ -347,27 +347,15 @@ describe('Collection (#findOneAnd...)', function () {
347347 await client ?. close ( ) ;
348348 } ) ;
349349
350- it (
351- 'the aggregation pipeline updates the matching document' ,
352- {
353- requires : {
354- mongodb : '>4.0'
355- }
356- } ,
357- async function ( ) {
358- const {
359- value : { _id, ...document }
360- } = await collection . findOneAndUpdate (
361- { a : 1 } ,
362- [ { $set : { a : { $add : [ 1 , '$a' ] } } } ] ,
363- {
364- includeResultMetadata : true ,
365- returnDocument : 'after'
366- }
367- ) ;
368- expect ( document ) . to . deep . equal ( { a : 2 , b : 1 } ) ;
369- }
370- ) ;
350+ it ( 'the aggregation pipeline updates the matching document' , async function ( ) {
351+ const {
352+ value : { _id, ...document }
353+ } = await collection . findOneAndUpdate ( { a : 1 } , [ { $set : { a : { $add : [ 1 , '$a' ] } } } ] , {
354+ includeResultMetadata : true ,
355+ returnDocument : 'after'
356+ } ) ;
357+ expect ( document ) . to . deep . equal ( { a : 2 , b : 1 } ) ;
358+ } ) ;
371359 } ) ;
372360
373361 context ( 'when passing includeResultMetadata: false' , function ( ) {
@@ -385,22 +373,14 @@ describe('Collection (#findOneAnd...)', function () {
385373 await client ?. close ( ) ;
386374 } ) ;
387375
388- it (
389- 'the aggregation pipeline updates the matching document' ,
390- {
391- requires : {
392- mongodb : '>4.0'
393- }
394- } ,
395- async function ( ) {
396- const { _id, ...document } = await collection . findOneAndUpdate (
397- { a : 1 } ,
398- [ { $set : { a : { $add : [ 1 , '$a' ] } } } ] ,
399- { returnDocument : 'after' }
400- ) ;
401- expect ( document ) . to . deep . equal ( { a : 2 , b : 1 } ) ;
402- }
403- ) ;
376+ it ( 'the aggregation pipeline updates the matching document' , async function ( ) {
377+ const { _id, ...document } = await collection . findOneAndUpdate (
378+ { a : 1 } ,
379+ [ { $set : { a : { $add : [ 1 , '$a' ] } } } ] ,
380+ { returnDocument : 'after' }
381+ ) ;
382+ expect ( document ) . to . deep . equal ( { a : 2 , b : 1 } ) ;
383+ } ) ;
404384 } ) ;
405385 } ) ;
406386 } ) ;
0 commit comments