How to convert a string to an integer in a JSON file using jq? : <p>I use jq to transform a complex json object into a tinier one. My query is:</p>

<pre><code>jq 'to_entries[]| {companyId: (.key), companyTitle: (.value.title), companyCode: (.value.booking_service_code)}' companies.json
</code></pre>

<p>Now, the <code>(.key)</code> is parsed as a string, yet I want <code>companyId</code> to be a number.</p>

<p>My result currently looks like this:</p>

<pre><code>{
  "companyId": "1337",
  "companyTitle": "Some company title",
  "companyCode": "oxo"
}
</code></pre>

<p>yet it should be like:</p>

<pre><code>{
  "companyId": 1337,
  "companyTitle": "Some company title",
  "companyCode": "oxo"
}
</code></pre>
