@@ -39,7 +39,7 @@ function makeTS(i) {
39
39
}
40
40
41
41
for ( 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 ) } ) ) ;
43
43
}
44
44
45
45
// 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");
235
235
assert . neq ( null , collScanStage , "no collection scan found in explain output: " + tojson ( res ) ) ;
236
236
237
237
// 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 ,
240
240
{ collation : { locale : "en_US" , strength : 2 } , capped : true , size : 16 * 1024 } ) ;
241
241
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 ( ) ) ;
246
246
247
247
// We expect correct results when "simple" collation specified and collection has a default
248
248
// 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 ) } ) ) ;
252
254
assert . eq ( 0 ,
253
- t_collation . find ( { str : "foo" , ts : { $gte : Timestamp ( 1000 , 1 ) } } )
255
+ testCollation . find ( { str : "foo" , ts : { $gte : Timestamp ( 1000 , 1 ) } } )
254
256
. collation ( { locale : "simple" } )
255
257
. itcount ( ) ) ;
256
258
} ( ) ) ;
0 commit comments