Collapse one level or all levels of array nesting.
Section: Arrays and Objects
Flatten nested arrays
bash
bash
echo '[[1,2],[3,[4]]]' | jq 'flatten'Explanation
`flatten` recursively flattens nested arrays into one array.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Arrays and Objects