[SERVER-19256] Support ordinary arithmetic parsing in Aggregation Created: 02/Jul/15 Updated: 06/Dec/22 Resolved: 11/Dec/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Chris Biow | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Won't Fix | Votes: | 1 |
| Labels: | usability | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query
|
| Participants: |
| Description |
|
Arithmetic expressions in Aggregation must now be coded by hand in a rather quirky JSON prefix notation of the form {$opName: ["$field1", "$field2"]}. This becomes unwieldy and impractical with expressions of even moderate complexity, as the operands themselves become JSON subdocuments. The server could better perform this function by accepting an expression in conventional infix operator precedence notation as used by most programming languages, of the form {$arithmetic: "field1 opSymbol field2"}. For example,
would translate to
|
| Comments |
| Comment by Chris Biow [ 02/Jul/15 ] |
|
A similar request appeared in the comments of |
| Comment by Chris Biow [ 02/Jul/15 ] |
|
Spring Framework SpEL expressions provide a similar capability to encode aggregation arithmetic in ordinary notation. |