Deleting multiple keys at once with jq
<p>I need to delete multiple keys at once from some JSON (using <code>jq</code>), and I'm trying to learn if there is a better way of doing this, than calling map and del every time. Here's my input data:</p>

<p><strong>test.json</strong></p>

<pre><code>[
  {
    "label": "US : USA : English",
    "Country": "USA",
    "region": "US",
    "Language": "English",
    "locale": "en",
    "currency": "USD",
    "number": "USD"
  },
  {
    "label": "AU : Australia : English",
    "Country": "Australia",
    "region": "AU",
    "Language": "English",
    "locale": "en",
    "currency": "AUD",
    "number": "AUD"
  },
  {
    "label": "CA : Canada : English",
    "Country": "Canada",
    "region": "CA",
    "Language": "English",
    "locale": "en",
    "currency": "CAD",
    "number": "CAD"
  }
]
</code></pre>

<p>For each item, I want to remove the number, Language, and Country keys. I can do that with this command:</p>

<pre><code>$ cat test.json | jq 'map(del(.Country)) | map(del(.number)) | map(del(.Language))'
</code></pre>

<p>That works fine, and I get the desired output:</p>

<pre><code>[
  {
    "label": "US : USA : English",
    "region": "US",
    "locale": "en",
    "currency": "USD"
  },
  {
    "label": "AU : Australia : English",
    "region": "AU",
    "locale": "en",
    "currency": "AUD"
  },
  {
    "label": "CA : Canada : English",
    "region": "CA",
    "locale": "en",
    "currency": "CAD"
  }
]
</code></pre>

<p>However, I'm trying to understand if there is a <code>jq</code> way of specifying multiple labels to delete, so I don't have to have multiple <code>map(del())</code> directives?</p>