Given the following xample.json;
xample.json
[ { \"id\": 12345678, \"stuff\": { \"book\": \"shelf\", \"hook\": \"line\", \"took\": \"off\", \"info-spec
I managed to figure it out.
$ jq '.[] | { id, "info-spec": .stuff["info-spec"] }' xample.json { "info-spec": 12, "id": 12345678 } { "info-spec": 23, "id": 12345679 }
The key here seems to be to use the newkey: .complex["key"] notation for lifting.
newkey: .complex["key"]