-
-
Notifications
You must be signed in to change notification settings - Fork 37
Draft: Filtering Collections #389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
There are some serious changes in the original solution provided by @zhenyabodukhin. Would like to know how these performed since then. Unit tests will make the thing perfect I guess. |
|
@torshid Only wrap arrays if there exists in filter not enough. You should combine them like this: I added cache to TransformerUtils, but its not works if you have similar paths in filter (only first will be applied). I can post my solution if it necessary. |
|
For example “tasks.text: ‘value1’ and tasks.text: ‘value2’” will not work. In this case you can refactor like this “tasks.text in [‘value1’, ‘value2’]” and it will work. But if we have like this “tasks.date:> ‘value1’ and tasks.date:< ‘value2’” will not work and this is a problem. In my project we escape this case, but for you this is bad solution :) |
|
I guess problem with same paths in filter is appear because i cache nodes and in wrapArrays methods i invokes method transform(), so again invokes wrapArrays and cache not work properly. So i added processedPath to solve this problem, as a result we have issue with same paths. I think if we has opportunity not to use transform() in arrayPaths() this problem will be solved. |
|
In my case I don't have nested Collections, which simplifies the issue for me. I added a post-processing stage to the filter generation, which flattens out nested and and or. Afterward, I merge the paths in the same and/or block if the mapping matches. I added some simple tests. |
|
Not sure how to provide an integration test like proof that it works for simple collections. |
Based on the described solution in the issue thread resolves #334. Have not yet implemented a fix for the Date problem.