[SERVER-9625] Support many accumulators in aggregation framework as expressions Created: 08/May/13 Updated: 28/Oct/15 Resolved: 11/Aug/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 2.4.3 |
| Fix Version/s: | 3.1.7 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Samuel Chou | Assignee: | James Cohan |
| Resolution: | Done | Votes: | 1 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||
| Sprint: | Quint Iteration 7, QuInt 8 08/28/15 | ||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||
| Description |
| Comments |
| Comment by Githook User [ 14/Aug/15 ] | |||||||||||||||||||||||||||||||||
|
Author: {u'username': u'jamesfcohan', u'name': u'James Cohan', u'email': u'james.cohan@10gen.com'}Message: | |||||||||||||||||||||||||||||||||
| Comment by Charlie Swanson [ 14/Aug/15 ] | |||||||||||||||||||||||||||||||||
|
cc jeff.yemin, we might need driver changes for this. | |||||||||||||||||||||||||||||||||
| Comment by Githook User [ 11/Aug/15 ] | |||||||||||||||||||||||||||||||||
|
Author: {u'username': u'jamesfcohan', u'name': u'James Cohan', u'email': u'james.cohan@10gen.com'}Message: | |||||||||||||||||||||||||||||||||
| Comment by Charlie Swanson [ 20/May/15 ] | |||||||||||||||||||||||||||||||||
|
Expanding the scope of this to include $avg as well. | |||||||||||||||||||||||||||||||||
| Comment by Mathias Stearn [ 09/May/13 ] | |||||||||||||||||||||||||||||||||
|
You can simplify your code a bit by defining these helper functions in python:
| |||||||||||||||||||||||||||||||||
| Comment by Samuel Chou [ 08/May/13 ] | |||||||||||||||||||||||||||||||||
|
Hi Andy, Thanks. Your workaround works for us, but for sure we'd love this to still be implemented. An example of an actual query we run (I simplified the original example):
| |||||||||||||||||||||||||||||||||
| Comment by Andy Schwerin [ 08/May/13 ] | |||||||||||||||||||||||||||||||||
|
The problem you're actually experiencing is that "$min" and "$max" only act as accumulators, not as document expression operators. It would be a good feature to support $min and $max in document expressions. For the time being, the following should do what you're looking for.
|