>_ IzzyLab

Topic breakdown

Aggregation in jq is built in two steps: first you need to get an array of the right values from the array of objects (the iteration .[] gives a stream, wrapping it in [...] collects it back into an array), and then reduce that array to a single number. For summing there is the built-in function add, which adds up all elements of the array. Both steps are connected by a pipe | — the output of one filter becomes the input of the next.

What's checked

  1. sum of amount is correct

What it looks like