@@ -194,13 +194,16 @@ const setFieldsIfExist = function(fieldList, source, target) {
194194 {
195195 // Project needed properties from user properties (up) so they are available in document root.
196196 $project : {
197- _id : '$fullDocument._id' ,
197+ __id : '$fullDocument._id' ,
198198 a : '$fullDocument.a' ,
199199 cd : '$fullDocument.cd' ,
200200 e : '$fullDocument.e' ,
201201 n : '$fullDocument.n' ,
202202 sg : '$fullDocument.sg' ,
203203 ts : '$fullDocument.ts' ,
204+ uid : '$fullDocument.uid' ,
205+ up : '$fullDocument.up' ,
206+ up_extra : '$fullDocument.up_extra' ,
204207 } ,
205208 } ,
206209 ] ,
@@ -326,7 +329,7 @@ const setFieldsIfExist = function(fieldList, source, target) {
326329 groupInsert . startTs = moment ( currEvent . ts ) . unix ( ) ;
327330 groupInsert . latest_version = currEvent . sg . app_version ;
328331 groupInsert . latest_version_for_sort = common . transformAppVersion ( currEvent . sg . app_version ) ;
329- groupInsert . lrid = `${ currEvent . _id } ` ;
332+ groupInsert . lrid = `${ currEvent . __id || currEvent . _id } ` ;
330333 groupInsert . error = currEvent . sg . error || '' ;
331334
332335 setFieldsIfExist ( buildSpecific , currEvent . sg , groupInsert ) ;
@@ -466,15 +469,15 @@ const setFieldsIfExist = function(fieldList, source, target) {
466469 if ( plugins . getConfig ( 'crashes' ) . same_app_version_crash_update ) {
467470 if ( crashGroup . latest_version && common . versionCompare ( currEvent . sg . app_version . replace ( / \. / g, ':' ) , crashGroup . latest_version . replace ( / \. / g, ':' ) ) >= 0 ) {
468471 group . error = currEvent . sg . error ;
469- group . lrid = `${ currEvent . _id } ` ;
472+ group . lrid = `${ currEvent . __id || currEvent . _id } ` ;
470473
471474 setFieldsIfExist ( buildSpecific , currEvent . sg , group ) ;
472475 }
473476 }
474477 else {
475478 if ( crashGroup . latest_version && common . versionCompare ( currEvent . sg . app_version . replace ( / \. / g, ':' ) , crashGroup . latest_version . replace ( / \. / g, ':' ) ) > 0 ) {
476479 group . error = currEvent . sg . error ;
477- group . lrid = `${ currEvent . _id } ` ;
480+ group . lrid = `${ currEvent . __id || currEvent . _id } ` ;
478481
479482 setFieldsIfExist ( buildSpecific , currEvent . sg , group ) ;
480483 }
@@ -536,15 +539,16 @@ const setFieldsIfExist = function(fieldList, source, target) {
536539 {
537540 // Project needed properties from user properties (up) so they are available in document root.
538541 $project : {
539- _id : '$fullDocument._id' ,
542+ __id : '$fullDocument._id' ,
540543 a : '$fullDocument.a' ,
541544 cd : '$fullDocument.cd' ,
542545 e : '$fullDocument.e' ,
543546 n : '$fullDocument.n' ,
547+ sg : '$fullDocument.sg' ,
544548 ts : '$fullDocument.ts' ,
545- up_extra : '$fullDocument.up_extra ' ,
549+ uid : '$fullDocument.uid ' ,
546550 up : '$fullDocument.up' ,
547- sg : '$fullDocument.sg'
551+ up_extra : '$fullDocument.up_extra' ,
548552 } ,
549553 } ,
550554 ] ,
@@ -635,14 +639,16 @@ const setFieldsIfExist = function(fieldList, source, target) {
635639 {
636640 // Project needed properties from user properties (up) so they are available in document root.
637641 $project : {
638- _id : '$fullDocument._id' ,
639- _uid : '$fullDocument._uid' ,
642+ __id : '$fullDocument._id' ,
640643 a : '$fullDocument.a' ,
641644 cd : '$fullDocument.cd' ,
642645 e : '$fullDocument.e' ,
643646 n : '$fullDocument.n' ,
644647 sg : '$fullDocument.sg' ,
645648 ts : '$fullDocument.ts' ,
649+ uid : '$fullDocument.uid' ,
650+ up : '$fullDocument.up' ,
651+ up_extra : '$fullDocument.up_extra' ,
646652 } ,
647653 } ,
648654 ] ,
0 commit comments