-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Query Optimization
Currently, there is a restriction where encrypted fields can only be compared to constant expressions, e.g.:
{$expr: {$eq: ["encryptedInt", {$add: [1, 2, 3]}]}}
This ticket is to extend support to expressions which resolve to constants, for example:
{$expr: {$eq: ["encryptedInt", {$cond: [{$eq: [$unencrypted, "abc"]}, 2, 3]}]}}.
The work required to support this is 1) allowing comparisons to expressions other than ExpressionConstant in query analysis (though we should still try to make sure the comparison will resolve to a constant) and 2) adding a new rewrite on the server-side to support more complicated query shapes.