Split one array into matching and non-matching groups.
Section: Grouping and Aggregation
Partition items by predicate
bash
bash
echo '[{"name":"a","active":true},{"name":"b","active":false}]' | jq '{active: map(select(.active)), inactive: map(select(.active | not))}'Explanation
Useful for dashboards and summary reports.
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 Grouping and Aggregation