@@ -39,7 +39,7 @@ function makeTS(i) {
3939}
4040
4141for ( let i = 1 ; i <= 100 ; i ++ ) {
42- assert . writeOK ( t . insert ( { _id : i , ts : makeTS ( i ) } ) ) ;
42+ assert . commandWorked ( t . insert ( { _id : i , ts : makeTS ( i ) } ) ) ;
4343}
4444
4545// A $gt query on just the 'ts' field should return the next document after the timestamp.
@@ -235,22 +235,24 @@ collScanStage = getPlanStage(res.executionStats.executionStages, "COLLSCAN");
235235assert . neq ( null , collScanStage , "no collection scan found in explain output: " + tojson ( res ) ) ;
236236
237237// We expect correct results when no collation specified and collection has a default collation.
238- const t_collation = db . getSiblingDB ( "local" ) . oplog . jstests_query_oplogreplay_collation ;
239- dropOplogAndCreateNew ( t_collation ,
238+ const testCollation = db . getSiblingDB ( "local" ) . oplog . jstests_query_oplogreplay_collation ;
239+ dropOplogAndCreateNew ( testCollation ,
240240 { collation : { locale : "en_US" , strength : 2 } , capped : true , size : 16 * 1024 } ) ;
241241
242- assert . writeOK ( t_collation . insert ( { str : "FOO" , ts : Timestamp ( 1000 , 0 ) } ) ) ;
243- assert . writeOK ( t_collation . insert ( { str : "FOO" , ts : Timestamp ( 1000 , 1 ) } ) ) ;
244- assert . writeOK ( t_collation . insert ( { str : "FOO" , ts : Timestamp ( 1000 , 2 ) } ) ) ;
245- assert . eq ( 2 , t_collation . find ( { str : "foo" , ts : { $gte : Timestamp ( 1000 , 1 ) } } ) . itcount ( ) ) ;
242+ assert . commandWorked ( testCollation . insert ( { str : "FOO" , ts : Timestamp ( 1000 , 0 ) } ) ) ;
243+ assert . commandWorked ( testCollation . insert ( { str : "FOO" , ts : Timestamp ( 1000 , 1 ) } ) ) ;
244+ assert . commandWorked ( testCollation . insert ( { str : "FOO" , ts : Timestamp ( 1000 , 2 ) } ) ) ;
245+ assert . eq ( 2 , testCollation . find ( { str : "foo" , ts : { $gte : Timestamp ( 1000 , 1 ) } } ) . itcount ( ) ) ;
246246
247247// We expect correct results when "simple" collation specified and collection has a default
248248// collation.
249- assert . writeOK ( t_collation . insert ( { str : "FOO" , ts : Timestamp ( 1000 , 0 ) } ) ) ;
250- assert . writeOK ( t_collation . insert ( { str : "FOO" , ts : Timestamp ( 1000 , 1 ) } ) ) ;
251- assert . writeOK ( t_collation . insert ( { str : "FOO" , ts : Timestamp ( 1000 , 2 ) } ) ) ;
249+ dropOplogAndCreateNew ( testCollation ,
250+ { collation : { locale : "en_US" , strength : 2 } , capped : true , size : 16 * 1024 } ) ;
251+ assert . commandWorked ( testCollation . insert ( { str : "FOO" , ts : Timestamp ( 1000 , 0 ) } ) ) ;
252+ assert . commandWorked ( testCollation . insert ( { str : "FOO" , ts : Timestamp ( 1000 , 1 ) } ) ) ;
253+ assert . commandWorked ( testCollation . insert ( { str : "FOO" , ts : Timestamp ( 1000 , 2 ) } ) ) ;
252254assert . eq ( 0 ,
253- t_collation . find ( { str : "foo" , ts : { $gte : Timestamp ( 1000 , 1 ) } } )
255+ testCollation . find ( { str : "foo" , ts : { $gte : Timestamp ( 1000 , 1 ) } } )
254256 . collation ( { locale : "simple" } )
255257 . itcount ( ) ) ;
256258} ( ) ) ;
0 commit comments