[SERVER-6175] don't allow mixing inclusion and exclusion in aggregation $project Created: 22/Jun/12 Updated: 11/Jul/16 Resolved: 17/Sep/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | 2.2.0 |
| Type: | Question | Priority: | Major - P3 |
| Reporter: | Aaron Staple | Assignee: | Mathias Stearn |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
Observed behavior: When a subfield is excluded, its parent field(s) will be included even if they would have otherwise been excluded.
Another effect of this behavior is that you cannot exclude both a field and its parent. So following on the above example you can't { $project: { a:0, 'a.b':0 }}. A human probably wouldn't write a projection like this, but a computer might. |
| Comments |
| Comment by Andy Schwerin [ 08/Mar/13 ] |
|
redbeard0531, is exclusion still forbidden in aggregation in 2.4? |
| Comment by Mathias Stearn [ 10/Jul/12 ] |
|
|
| Comment by auto [ 10/Jul/12 ] |
|
Author: {u'date': u'2012-07-05T12:49:54-07:00', u'email': u'mathias@10gen.com', u'name': u'Mathias Stearn'}Message: Clean up parseObject() a bit prep for |
| Comment by auto [ 10/Jul/12 ] |
|
Author: {u'date': u'2012-07-05T12:07:09-07:00', u'name': u'Mathias Stearn', u'email': u'mathias@10gen.com'}Message: Clean up DocumentSourceProject::createFromBson and make it more like normal projections Prep for |
| Comment by Mathias Stearn [ 03/Jul/12 ] |
|
For now I think we should adopt the same rule as the existing projections: you can't mix inclusion and exclusion (except for _id). The initial reason for that is that we couldn't come up with good semantics for mixing, and I haven't heard a good plan for that yet. |