Implement a new aggregation pipeline in the statistics module that groups export events by month and user ID, computing total exports per user per month. The pipeline uses MongoDB's $group stage with date truncation to month granularity, and stores results in a new `monthly_export_stats` collection. This enables generation of per-user activity reports for the admin dashboard.
5.7 KiB
5.7 KiB