title: Converting values to JSON grouped by another column
body: <p>I have a table that looks like this:</p>
  
  <pre><code>currency   number
  USD        1
  USD        2
  USD        3
  EUR        1
  EUR        5
  EUR        6
  GBP        1
  GBP        7
  </code></pre>
  
  <p>I am trying to convert this into a JSON (Postgres) that is set by each currency, and get an output that looks like this:</p>
  
  <pre><code>currency      number
  USD           [1,2,3]
  EUR           [1,5,6]
  GBP           [1,7]
  </code></pre>
  
  <p>Can anyone help? Thanks!</p>