[SERVER-9289] Date operators incorrectly throw exceptions for object arguments Created: 08/Apr/13 Updated: 11/Jul/16 Resolved: 24/Sep/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | 2.4.1 |
| Fix Version/s: | 2.5.3 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Jeremy Mikola | 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: | Fully Compatible | |||||||||||||||||||||||
| Operating System: | ALL | |||||||||||||||||||||||
| Steps To Reproduce: |
|
|||||||||||||||||||||||
| Participants: | ||||||||||||||||||||||||
| Description |
|
The $year operator (and possibly others) throws an exception if the argument is an object (i.e. the result of a computation). Internally, it seems to be rejecting the argument due to legacy code for named arguments. Wrapping the object argument in an array bypasses the bug. |
| Comments |
| Comment by Mathias Stearn [ 24/Sep/13 ] |
|
This was fixed during an earlier refactor. Just added tests to ensure it stays fixed. |
| Comment by auto [ 24/Sep/13 ] |
|
Author: {u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}Message: Test for The bug was fixed in earlier refactoring of Expression parsing. |
| Comment by auto [ 19/Aug/13 ] |
|
Author: {u'username': u'RedBeard0531', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}Message: Unify agg Expression parsing to eliminate special cases Also fixes |
| Comment by Mathias Stearn [ 08/Apr/13 ] |
|
This applies to any single-argument expression. To pass a subexpression as a single argument, it will need to wrapped in an array (of one element). |