I have a collection containing 15,000 documents. Due to numerous lookups, pagination becomes significantly large. In the provided code snippet, I follow the documentation's guidance by performing aggregation before pagination.
However, this approach does not lead to any performance improvement because aggregation is executed prior to pagination.
Is it possible to first implement pagination and then apply lookup and projection to this paginated data?
I have a collection containing 15,000 documents. Due to numerous lookups, pagination becomes significantly large. In the provided code snippet, I follow the documentation's guidance by performing aggregation before pagination.
However, this approach does not lead to any performance improvement because aggregation is executed prior to pagination.
Is it possible to first implement pagination and then apply lookup and projection to this paginated data?