-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Enhancing the new Filtering with a wildcard #1309
Comments
Great feature @bblanchon! My wildcard filtering is not working exactly as expected and I'd really appreciate some feedback.
Say that I want to filter on the key "10". I did this:
and I expected to retain only USER2's details and higher levels (including associated user data).
However, I'm not keeping the "associated" data, but I am keeping some of USER1 details as below: Am I missing something or is the wildcard not as flexible as I was hoping? |
Hi @joysfera, This is the expected behavior: the filter doesn't trim empty objects. Best regards, |
FYI, it was @jshep321 :-) |
Will do. I will write a test program instead of manually edited json in the comments (as I have omitted several quotes above!). |
The cool filtering while deserializing introduced in v6.15 is great but it could be even better if there was a possibility to specify a wildcard for parents of nested documents if you need to filter somewhere deeper in the tree.
Imagine JSON document like this:
And I'd need to filter out the names (because they're long and consume a lot of precious RAM) and preserve just the key names (that unfortunately hold some important information) and the values inside of their objects (because the values are what matters).
So the Filtering document would need to look kind of like this:
{ "*": { "value": true } }
Would this be possible to implement easily and cleanly, please? Or any better idea?
Thank you!
The text was updated successfully, but these errors were encountered: