Construct nested output structures.
Section: Object Basics
Build nested object
bash
bash
echo '{"first":"Alice","last":"Ng","team":"eng"}' | jq '{user: {full_name: (.first + " " + .last)}, meta: {team}}'Explanation
jq object construction supports arbitrary expressions as values.
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 Object Basics