[SERVER-46670] Document the behavior when projection includes fields "a" and "a.b" Created: 06/Mar/20 Updated: 09/Mar/20 Resolved: 09/Mar/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 4.0.14 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Yao Wei | Assignee: | Ian Boros |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | qexec-team | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Sprint: | Query 2020-03-23 | ||||||||
| Participants: | |||||||||
| Description |
|
We found out that when projection includes "a" and "a.b", that is, parent and child document are both in the projection, the order in BSON Document is prominent. For example: These two are equivalent: db.document.find({}, {"a.b":1, "a":1}) and these two: db.document.find({}, {"a":1, "a.b":1}) I am wondering whether it is undocumented behavior, or it should be able to include the parent document regardless of the order. |
| Comments |
| Comment by Ian Boros [ 09/Mar/20 ] |
|
Hello mwei, I believe this is more or less a duplicate of Feel free to comment here if you have any questions! I will close this ticket as a duplicate of IB |
| Comment by Yao Wei [ 06/Mar/20 ] |
|
Correction on the descriptions. These two are equivalent, instead of the latter two in the issue description: db.document.find({}, {"a":1, "a.b":1}) |