[SERVER-73074] Add splitMatchExpressionBy test cases for $jsonSchema.required expression Created: 19/Jan/23 Updated: 29/Oct/23 Resolved: 03/Feb/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 6.3.0-rc0 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Charlie Swanson | Assignee: | Yoon Soo Kim |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Storage Execution
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Participants: | |||||||||
| Description |
|
In |
| Comments |
| Comment by Githook User [ 03/Feb/23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Author: {'name': 'Yoonsoo Kim', 'email': 'yoonsoo.kim@mongodb.com', 'username': 'yun-soo'}Message: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Mohammad Dashti (Inactive) [ 02/Feb/23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
One of the issues is related to improving the implementation of the isIndependentOf function. This one calls the hasOnlyRenameableMatchExpressionChildren function, which fails on this line (as all jsonSchema-related expression types are categorized as "Other". It seems that the lack of support for the jsonSchema expressions was deliberate at the time of implementing expression::splitMatchExpressionBy. Nevertheless, as you mentioned, there might be a subset of examples with jsonSchema that are supported out-of-the-box. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Mohammad Dashti (Inactive) [ 02/Feb/23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
yoonsoo.kim@mongodb.com Here is the test I used to come up with the result of jsonSchema is currently not supported in expression_algo::splitMatchExpressionBy:
Here is the output:
It's expected for residual to be empty, but it is not the case in either of these tests. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Yoon Soo Kim [ 01/Feb/23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
It sounds like that the logic that we want to replace can be achieved by splitMatchExpressionBy(...,isOnlyDependentOn). Adding test cases. The $jsonSchema expression of interest is $jsonSchema: {required: [field]} and it's translated into {field: {$exists: true}}. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Mohammad Dashti (Inactive) [ 30/Jan/23 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
jsonSchema is currently not supported in expression_algo::splitMatchExpressionBy. |