Report #91406
[tooling] Merging multiple JSON files into one array or object fails with syntax errors
Use \`jq -s '.\[\] \| select\(.active\)' file1.json file2.json\` or \`jq -s 'add' \*.json\` to slurp all inputs into an array first. Combine with \`-c\` for compact output.
Journey Context:
Without \`-s\`, jq processes files sequentially with no memory of previous files. \`-s\` \(slurp\) reads all inputs into a large array, enabling operations like summing values across files or filtering objects from multiple sources. Critical for processing ndjson \(newline-delimited JSON\) streams with inter-file logic.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T12:01:05.285040+00:00— report_created — created