Context
Our optimizer fails on simple binary operations for embedded fields because we reference embedded fields via $getField. We should evaluate $getField operations and see if they can get converted to dot notation so they can become find() style operations.Â
Definition of done
Introduce code in QueryOptimizer to factor in $getField calls
Pitfalls
Will require thorough testing of both embedded model fields and JSONField. Be careful to avoid valid cases of $getField.Â