Hitting the limitations of MongoDB (in a single machine environment), I wonder which part of MapReduce and aggregation with group/$group is causing the troubles.
Usually I use a mix of MR/Aggregation for counting documents with unique identifiers inside. Such an identifier could be based on a single field or also a combination of several fields etc.
Before counting the uniques, some $match/filtering is done first for the pipeline.
Anyways, mongodb sometimes worries about the maximum document size and sometimes when exceeding 16M with $group.
How to estimate the amount of size because I really wonder if something is done wrong in my aggregation or if 16M is really a worse limitation and makes mongodb's aggregation framework useless for my "tiny" database with 50GB of data on the single machine => poor :-(