Extracting Objects Recursively with Jq

# · 🔥 268 · 💬 71 · 2 years ago · til.simonwillison.net · edward · 📷
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.
Extracting Objects Recursively with Jq



Send Feedback | WebAssembly Version (beta)