Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-65324

Allow comparisons of encrypted fields to expressions which resolve to constants

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 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.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            hana.pearlman@mongodb.com Hana Pearlman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: