This commit is contained in:
Emily
2025-03-14 16:40:50 +01:00
parent d1b3e997c1
commit afda29997d
11 changed files with 247 additions and 30 deletions

View File

@@ -24,6 +24,28 @@ export default defineEventHandler(async event => {
customProjection: {
count: { $divide: ["$duration", "$count"] }
},
customQueries: [
{
index: 1,
query: {
"$lookup": {
"from": "visits",
"localField": "session",
"foreignField": "session",
"as": "visits",
"pipeline": [{ "$limit": 1 }]
}
},
},
{
index: 2,
query: {
"$match": {
"visits.0": { "$exists": true }
}
}
}
]
});
const timelineFilledMerged = fillAndMergeTimelineAggregationV2(timelineData, slice, from, to);
return timelineFilledMerged;