You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unfortunately, the filtering feature introduced in ArduinoJson 6.15 only allows including/excluding members based on the key, not the value. Admittedly, this is pretty limited but it's sufficient for many use cases and has a minimal impact on code size.
Filtering by value has been requested several times (#1486 (comment), #1316, #1708) but has not been implemented because it's much more complicated than it seems.
Indeed, there are tricky use cases to cover; for example, you could exclude all "users" objects whose age is "< 18" (and that's an easy one).
If you go down this road, you soon realize that you need the equivalent of a WHERE clause in SQL.
This could be implemented with a callback in the filter document, but this is incompatible with the design constraints for ArduinoJson 6, which forbids virtual functions.
Another solution would be to support JSONPath, but the language is complex, so the implementation would require a lot of work and would be quite big.
With the current implementation, your options are:
Hi how can i filter with Assistant this
[ { "id": 1, "ingredients": [ { "id": 5, "amount": 108 }, { "id": 8, "amount": 12 } ] }, { "id": 2, "ingredients": [ { "id": 4, "amount": 12 }, { "id": 6, "amount": 108 } ] }, { "id": 3, "ingredients": [ { "id": 4, "amount": 24 }, { "id": 6, "amount": 96 } ] }, { "id": 4, "ingredients": [ { "id": 4, "amount": 12 }, { "id": 5, "amount": 108 } ] }, { "id": 5, "ingredients": [ { "id": 4, "amount": 24 }, { "id": 5, "amount": 96 } ] } ]
for example only ID 2
[ { "id": 2, "ingredients": [ { "id": 4, "amount": 12 }, { "id": 6, "amount": 108 } ] } ]
Thanks for your help
The text was updated successfully, but these errors were encountered: