Hacker News new | past | comments | ask | show | jobs | submit

How to Use JSON Path

https://bump.sh/blog/how-to-use-json-path
One of the best tools I've found for manipulating JSON via JsonPath syntax is https://jsonata.org

In addition to simple queries that allow you to select one (or multiple) matching nodes, it also provides some helper functions, such as arithmetic, comparisons, sorting, grouping, datetime manipulation, and aggregation (e.g. sum, max, min).

It's written in JS and can be used in Node or in the browser, and there's also a Python wrapper: https://pypi.org/project/pyjsonata/

loading story #40259264
loading story #40247207
loading story #40250747
loading story #40247663
loading story #40245811
loading story #40251934
loading story #40251203
loading story #40245757
loading story #40246397
Is the necessity of tools like JSON Path really just an indication that APIs are increasingly returning too much junk and / or way more data than the client actually requested and / or needs?

In dev mode, our internal APIs return pretty printed JSON so one can inspect via view-source, more, or text editor.

loading story #40247291
loading story #40246074
loading story #40261754
I am kind of surprised that they don't mention jq at all, it seems like a similar tool that is fairly wide spread.
loading story #40250716
loading story #40251302
loading story #40251872
loading story #40246457
loading story #40253031
loading story #40250784
loading story #40247101
loading story #40247741
loading story #40246542
loading story #40246503
loading story #40249539
loading story #40252121
loading story #40245862
loading story #40249122