How to use MongoDB aggregation pipeline for real-time analytics on sharded cluster with big data but no lag?
I am working on a project that involves real-time analytics on a large dataset stored in a sharded MongoDB cluster. I need to use the aggregation pipeline to process this data efficiently, but I am experiencing performance issues. Specifically, I want to ensure that my queries run with minimal lag. Here is the pipeline I am using: