I have a process in which I am currently using the Mongo Map / Reduce framework, but it does not work very well. This is a fairly simple aggregation, where I bucketize over 3 fields, returning the sum of 4 different fields and going through the values ββfor 4 more fields (which are constant in each bucket).
For the reasons described in [ Map-Reduce Performance in MongoDb 2.2, 2.4, and 2.6 ], I would like to convert this to an aggregation structure for better performance, but there are three things that stand in the way, I think:
- The overall result can be large, exceeding the Mongo 16MB limit, although any document as a result is very small.
- I can directly convert / demolish to another collection, but the aggregation structure can only return inline results (I think?)
- For incremental updates, as more data arrives in the original collection, I can display / reduce using
MapReduceCommand.OutputType (in Java) installed in REDUCE , exactly coinciding with my use case, but I do not see the corresponding function in the aggregation structure.
Are there any good ways to solve these problems in the aggregation structure? Now the server is version 2.4.3 - perhaps we will update it if there are new features.
source share