Typically I use something like JSONPath [1] (basically XPath for JSON) [2] or jq for this but having more options with other syntax and style is helpful.
For streamed JSON like NDJSON [3] there are some nice filtering options [4]
[1] https://en.wikipedia.org/wiki/JSONPath
[2] https://datatracker.ietf.org/doc/html/rfc9535
[3] https://github.com/ndjson/ndjson-spec
[4] https://github.com/mbostock/ndjson-cli?tab=readme-ov-file#fi...
I've also used https://github.com/uwdata/arquero once (better performance for large datasets).
data.filter(d => d.friends.includes("John")).map(d => ({name: d.name+" "+d.lastName}))
Maybe I'm missing the bigger picture, but that doesn't seem so bad