JSON happens to have its own query language in the form of
JMESPATH.
I didn't know this was thing until fairly recently. I stumbled across it by chance while fishing for VS Code Extensions to help me wrangle with deeply nested JSON objects.
Came across an awesome extension called
JSON Transform for VS Code by Pine Wu. Basically it allows you to use JMESPATH queries to execute transformations on JSON files.
Outside of VSCode I also found a
Javascript implementation of JMESPATH on github; I'm thinking I might be able to use these queries natively in Apps Script (probably need to transpile it down to ES5 to ensure compatibility).
Should prove useful to folks that often work with complex JSON objects.
UPDATELooks like we can use the
jmespath.js file from the github repo. Haven't tested it yet but the code does not seem to have any ES6 syntax so we should be able to just drop in into an Apps Script project as is (might want to run it through a minifier first to reduce the size). The Github repo has instructions on how to use the library. Have at it.
UPDATE