For anyone struggling with jq's syntax, I recommend taking a look at fx [1]
which uses JavaScript as the query language.
The author of the tool has also written a guide [2] and recorded a screencast [3] about the tool.
[1] https://github.com/antonmedv/fx
[2] https://medium.com/@antonmedv/discover-how-to-use-fx-effecti...