title: How do I sum the values in an array of maps in jq?
body: <p>Given a JSON stream of the following form:</p>
  
  <pre><code>{ "a": 10, "b": 11 } { "a": 20, "b": 21 } { "a": 30, "b": 31 }
  </code></pre>
  
  <p>I would like to sum the values in each of the objects and output a single object, namely:</p>
  
  <pre><code>{ "a": 60, "b": 63 }
  </code></pre>
  
  <p>I'm guessing this will probably require flattening the above list of objects into a an array of <code>[name, value]</code> pairs and then summing the values using <code>reduce</code> but the documentation of the syntax for using <code>reduce</code> is woeful.</p>