-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
Query Optimization
Currently, $$REMOVE is treated like a $let variable by the expression schema walker, and so is represented by an NotEncryptedNode in the schema tree. However, this means that aggregations cannot conditionally include or exclude encrypted fields with matching encryption in a $project stage, and then later match or group on that field, since the combination of $$REMOVE with the encrypted field will result in a MixedStateNode. Instead, $$REMOVE should just not result in the addition/reconciliation of any schema nodes.