[SERVER-7623] comparison operation right hand side should be expressions Created: 12/Nov/12 Updated: 06/Dec/22 Resolved: 23/Nov/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Eliot Horowitz (Inactive) | Assignee: | Backlog - Query Team (Inactive) |
| Resolution: | Duplicate | Votes: | 18 |
| 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 |
|
{ x : { $sum : [ "$y" , 3 ] }} |
| Comments |
| Comment by Asya Kamsky [ 23/Nov/17 ] | |
|
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 | |
| Comment by William Cross [ 22/Mar/17 ] | |
|
+1. Would love this to be the case. | |
| Comment by Nicholas Johnson [ 15/Jul/15 ] | |
|
This would remove an area of inconsistency, and would make find much more useful. It would be possible to do a lot more before dipping into the aggregate pipeline, and would discourage new developers from using $where unnecessarily. | |
| Comment by Patrick Grandjean [ 21/Feb/13 ] | |
|
db.col.find({ "a.b": { $eq: "$a.c" }}) That would change my life |