[SERVER-70236] [CQF] Order of fields in output documents of computed projections/addFields changes in CQF Created: 05/Oct/22 Updated: 05/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Hana Pearlman | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query Optimization
|
||||||||
| Participants: | |||||||||
| Description |
|
For $addFields: Consider document
and query
For classic, the order of fields in the output document is "c" followed by the added fields in the order specified by the addFields. For CQF, the order of fields in the output document is "c" followed by "b", then "a", then "d". For computed projection mixed with simple inclusion: Consider document
and query
For classic, the order of fields in the output document is "a1" followed by "a0". For CQF, the order of fields in the output document is "a0" followed by "a1". Something very similar happens with only computed projections (i.e., not mixed with simple inclusion)-- CQF orders the fields alphabetically, while classic orders them according to the projection spec. Filed as one ticket because I think the root cause is similar. |