Extracting Objects Recursively with Jq
The Algolia-powered Hacker News API returns nested comment threads that look like this: https://hn. I wanted to flatten this into an array of items so I could send it to sqlite-utils insert. Children[]) recurses through a list of everything in a.children array. Children) then deletes that array from the returned objects. Wrapping it all in [ ] ensures the overall result will be an array.