-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Query Execution
-
ALL
It's not exactly clear what the absolute minimal reproducer is here, but it seems that for certain combinations of arrays, sub-objects, and computed projections, the classic engine can produce output with fields reordered relative to their position in the inclusion projection.
For example, given an input document
{ _id: 1, 'array': [], 'obj': {}, }
and pipeline
[{$project: { 'array': [], 'obj.array': [] }}]
we produce
{ '_id': 1, 'obj': {'array': []}, 'array': [] }
This problem seems to go back quite a long way (at least 4.2), but was recently surfaced by the aggregation_optimization_fuzzer in BF-24359 (it appears we do not have the same behavior in SBE).