Complex aggregation pipelines vs complex programming logic

Very interesting topic.

See some of my previous posts that are related.

There are times where it is better to do things on the server. One such time is when it reduce the amount of data transferred. Using $map and $filter to only returned the subset of data of interest is definitively such a case.