[SERVER-7932] Change handling of nullish values in math expressions Created: 13/Dec/12 Updated: 28/Oct/15 Resolved: 17/Dec/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | 2.3.2 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Mathias Stearn | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Backwards Compatibility: | Major Change | ||||
| Operating System: | ALL | ||||
| Participants: | |||||
| Description |
|
Currently when a nullish (missing/EOO, Undefined, or Null) value is used in a math expression such as $add, we treat it as 0. I think a better behavior would be to make the output always be NULL if any input value is nullish. If users want the old behavior, they can use $ifNull:
Note: this change only applies to the expressions $add, $multiply, $subtract, etc. The $group accumulators ($min, $max, $sum, and $avg) will continue to ignore nullish values. |
| Comments |
| Comment by auto [ 15/Dec/12 ] |
|
Author: {u'date': u'2012-12-14T21:02:41Z', u'email': u'mathias@10gen.com', u'name': u'Mathias Stearn'}Message: Improve aggregation handling of nullish Values - part 2 Changes:
Related Tickets: |