aggregation optimization

This commit is contained in:
Emily
2024-09-02 18:36:52 +02:00
parent d499aa2f39
commit c003b655ec
6 changed files with 32 additions and 21 deletions

View File

@@ -46,7 +46,7 @@ export async function executeAdvancedTimelineAggregation<T = {}>(options: Advanc
console.log(JSON.stringify(aggregation, null, 2));
}
const timeline: { _id: string, count: number & T }[] = await options.model.aggregate(aggregation);
const timeline: { _id: string, count: number & T }[] = await options.model.aggregate(aggregation, { explain: options.debug === true });
return timeline;