[SERVER-14565] New aggregation operators Created: 15/Jul/14 Updated: 20/Mar/15 Resolved: 16/Jul/14 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Ben Rotz | Assignee: | Ramon Fernandez Marina |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Participants: | |||||||||||||
| Description |
|
It would be useful to me if there were a few new operations in the agg framework in the Array Aggregation Operators section (alongside the existing operator $size, perhaps? Or the new $max/$min operators could be alongside the arithmetic operators $add, $multiply, etc.) //existing operator $size for reference //NEW operator $selectIndex //returns 3 //NEW operator $max //NEW operator $min in particular, the $selectIndex operator would be very valuable to me to convert an array into a simple value, as seen in this mongo google group posting: https://groups.google.com/forum/#!topic/mongodb-user/qmtAeojf68g |
| Comments |
| Comment by Asya Kamsky [ 20/Mar/15 ] |
|
nefiga would a $slice array operator in $project allow you to accomplish what you described with your $selectIndex operator? |
| Comment by Ben Rotz [ 18/Jul/14 ] |
|
While I agree that I have hundreds of millions of rows in one collection, which have a field that corresponds to a much smaller collection (thousands). I'd love to be able to "join" to this other collection in memory to pull fields that are more dynamic in the smaller collection for purposes of aggregating in a $group stage. This could easily be done if there was some sort of $selectedIndex in the array operators section of the aggregation framework, right next to $size, because then the array just becomes an in-memory array in a $let clause. Both of these operators can project an array into a single field, which is exactly what I want. |
| Comment by Ramon Fernandez Marina [ 16/Jul/14 ] |
|
nefiga, similar functionality has already been requested in |