@@ -402,7 +402,10 @@ describe('Testing event settings', function() {
402
402
403
403
it ( 'checking for segmentation in collections(test3)' , function ( done ) {
404
404
var collectionNameWoPrefix = crypto . createHash ( 'sha1' ) . update ( "test3" + APP_ID ) . digest ( 'hex' ) ;
405
- testUtils . db . collection ( "events" + collectionNameWoPrefix ) . find ( { "s" : { $in : [ "my_segment" ] } } ) . toArray ( function ( err , res ) {
405
+ testUtils . db . collection ( "events_data" ) . find ( { "_id" : { "$regex" : ( "^" + APP_ID + "_" + collectionNameWoPrefix + "_.*" ) } , "s" : { $in : [ "my_segment" ] } } ) . toArray ( function ( err , res ) {
406
+ if ( err ) {
407
+ console . log ( err ) ;
408
+ }
406
409
if ( res . length == 0 ) {
407
410
done ( ) ;
408
411
}
@@ -465,7 +468,7 @@ describe('Testing event settings', function() {
465
468
466
469
it ( 'checking for segmentation in collections(test3)' , function ( done ) {
467
470
var collectionNameWoPrefix = crypto . createHash ( 'sha1' ) . update ( "test3" + APP_ID ) . digest ( 'hex' ) ;
468
- testUtils . db . collection ( "events" + collectionNameWoPrefix ) . find ( { "s" : { $in : [ "my_segment" ] } } ) . toArray ( function ( err , res ) {
471
+ testUtils . db . collection ( "events_data" ) . find ( { "_id" : { "$regex" : ( "^" + APP_ID + "_" + collectionNameWoPrefix + "_.*" ) } , "s" : { $in : [ "my_segment" ] } } ) . toArray ( function ( err , res ) {
469
472
if ( res . length == 0 ) {
470
473
done ( ) ;
471
474
}
@@ -516,7 +519,7 @@ describe('Testing event settings', function() {
516
519
517
520
it ( 'checking for segmentation in collections(t1)' , function ( done ) {
518
521
var collectionNameWoPrefix = crypto . createHash ( 'sha1' ) . update ( "t1" + APP_ID ) . digest ( 'hex' ) ;
519
- testUtils . db . collection ( "events" + collectionNameWoPrefix ) . find ( { "s" : { $in : [ "s" ] } } ) . toArray ( function ( err , res ) {
522
+ testUtils . db . collection ( "events_data" ) . find ( { "_id" : { "$regex" : ( "^" + APP_ID + "_" + collectionNameWoPrefix + "_.*" ) } , "s" : { $in : [ "s" ] } } ) . toArray ( function ( err , res ) {
520
523
if ( res . length == 0 ) {
521
524
done ( ) ;
522
525
}
@@ -676,7 +679,7 @@ describe('Testing event settings', function() {
676
679
677
680
it ( 'checking for segmentation in collections(t5)' , function ( done ) {
678
681
var collectionNameWoPrefix = crypto . createHash ( 'sha1' ) . update ( "t5" + APP_ID ) . digest ( 'hex' ) ;
679
- testUtils . db . collection ( "events" + collectionNameWoPrefix ) . find ( { "s" : { $in : [ "bad_segment" ] } } ) . toArray ( function ( err , res ) {
682
+ testUtils . db . collection ( "events_data" ) . find ( { "_id" : { "$regex" : ( "^" + APP_ID + "_" + collectionNameWoPrefix + "_.*" ) } , "s" : { $in : [ "bad_segment" ] } } ) . toArray ( function ( err , res ) {
680
683
if ( res . length == 0 ) {
681
684
done ( ) ;
682
685
}
0 commit comments