[SERVER-9366] Expose projection (aggregation) operators in regular find queries Created: 17/Apr/13 Updated: 06/Dec/22 Resolved: 16/Jan/18 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Alon Horev | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Duplicate | Votes: | 4 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||
| Assigned Teams: |
Query
|
||||||||||||||||||||||||||||||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||||||||||||||||||||||||||||||
| Participants: | |||||||||||||||||||||||||||||||||||||
| Description |
|
Operators like: ($)add, divide, multiply, hour, etc' can be very useful in regular 'find' queries and not only aggregations. Is there any special reason for this lack of consistency between regular 'find' queries and the aggregation framework? This is possibly linked to: allow referencing fields on the right-hand-side of operators: |
| Comments |
| Comment by Asya Kamsky [ 16/Jan/18 ] | |
|
This can now be done using $expr, which allows you to use aggregation expressions in the match language:
See documentation for the feature here: https://docs.mongodb.com/master/reference/operator/query/expr/ The work was done as |