|
Both, the localField and foreignField, can be paths and we need to generate correct traversal sub-trees for them.
Notes:
1. paths with numbers, such as "a.0.b" aren't lowered for find queries so we should not lower $lookup stages that use them either
2. the path traversal logic in the classic engine can be found here: https://github.com/10gen/mongo/blob/3a0132fcb97a7559b9bfdb0021b25e30f873acb1/src/mongo/db/pipeline/document_source_lookup.cpp#L832-L837. We should strive to replicate it unless we explicitly decide not to (which should be then documented by separate tickets)
|