[SERVER-41991] [FLE] $$REMOVE should not add a NotEncryptedNode to the schema tree. Created: 27/Jun/19 Updated: 05/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Davis Haupt (Inactive) | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | query-44-grooming | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Query Optimization
|
| Participants: |
| Description |
|
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. |
| Comments |
| Comment by David Storch [ 27/Jun/19 ] | ||||||||||||||
|
I changed this from "Bug" to "Improvement", which hides the "Steps to Reproduce" field. Recording the helpful example from davis.haupt here: Sending this pipeline to mongocryptd
Will result in the error "Cannot get metadata for path whose encryption properties are not known until runtime." |