Skip to content

Commit 9b69a2d

Browse files
committed
[views] Add old drill event collection to heatmap result
1 parent a4fc372 commit 9b69a2d

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

plugins/views/api/api.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1667,7 +1667,6 @@ const escapedViewSegments = { "name": true, "segment": true, "height": true, "wi
16671667

16681668
const aggregateQuery = [
16691669
{ $match: matchQuery },
1670-
{ $project: projectionQuery },
16711670
];
16721671

16731672
const use_union_with = plugins.getConfig('drill', params.app_id && params.app && params.app.plugins, true).use_union_with;
@@ -1717,8 +1716,18 @@ const escapedViewSegments = { "name": true, "segment": true, "height": true, "wi
17171716
if (moreMeta && moreMeta.sg && moreMeta.sg.domain) {
17181717
common.arrayAddUniq(result.domains, Object.keys(moreMeta.sg.domain.values));
17191718
}
1719+
1720+
const matchQueryOld = Object.assign({}, matchQuery);
1721+
delete matchQueryOld.a;
1722+
delete matchQueryOld.e;
1723+
1724+
aggregateQuery.push({
1725+
$unionWith: { coll: oldCollectionName, pipeline: [{ $match: matchQueryOld }] },
1726+
});
17201727
}
17211728

1729+
aggregateQuery.push({ $project: projectionQuery });
1730+
17221731
try {
17231732
const data = await common.drillDb.collection('drill_events').aggregate(aggregateQuery, { allowDiskUse: true }).toArray();
17241733
result.data = data;

0 commit comments

Comments
 (0)