I used a RunMongoAggregation processor to aggregate MongoDB collection and expected it to return around 10k+ documents. Upon running of the processor, I encountered following error: "exceeded memory limit for $group, but didn't allow external sort".
Based on MongoDB documentation, $group might have some limitation:
The $group stage has a limit of 100 megabytes of RAM. By default, if the stage exceeds this limit, $group will produce an error. However, to allow for the handling of large datasets, set the allowDiskUse option to true to enable $group operations to write to temporary files.
I tried to add allowDiskUse option, but it was not working i.e. same issue