Represent an object as key-value entry objects.
Section: Variables, Reduce, and Advanced Transformations
Convert object to entries array
bash
bash
echo '{"a":1,"b":2}' | jq 'to_entries'Explanation
Useful when you need to filter or sort by object keys or 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 Variables, Reduce, and Advanced Transformations
Convert entries back to object
Turn key-value entry objects into a normal object.
Recursively transform all strings
Walk the document and mutate matching values.