title: JQ: replace an array element, based on subelement value
body: <p>I want to modify the value of <code>DOMAIN_DISABLE</code> to true if <code>DOMAIN</code> equals <code>domain1.com</code></p>
  <pre class="lang-sh prettyprint-override"><code>jq 'if .DATA[].DOMAIN == &quot;domain1.com&quot; then .DATA[].DOMAIN_DISABLE = true else . end' &quot;${Json}&quot;
  </code></pre>
  <p>Json Array:</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;ACTION&quot;: &quot;domain.list&quot;,
      &quot;DATA&quot;: [
          {
              &quot;TYPE&quot;: &quot;slave&quot;,
              &quot;AXFR_IPS&quot;: &quot;none&quot;,
              &quot;DOMAIN&quot;: &quot;domain1.com&quot;,
              &quot;TTL_SEC&quot;: 0,
              &quot;SOA_EMAIL&quot;: &quot;&quot;,
              &quot;DOMAINID&quot;: 11111,
              &quot;DESCRIPTION&quot;: &quot;&quot;,
              &quot;EXPIRE_SEC&quot;: 0,
              &quot;RETRY_SEC&quot;: 0,
              &quot;STATUS&quot;: 1,
              &quot;DOMAIN_DISABLE&quot;: false,
              &quot;LPM_DISPLAYGROUP&quot;: &quot;&quot;,
              &quot;REFRESH_SEC&quot;: 0
          },
          {
              &quot;TYPE&quot;: &quot;slave&quot;,
              &quot;AXFR_IPS&quot;: &quot;none&quot;,
              &quot;DOMAIN&quot;: &quot;domain2.net&quot;,
              &quot;TTL_SEC&quot;: 0,
              &quot;SOA_EMAIL&quot;: &quot;&quot;,
              &quot;DOMAINID&quot;: 22222,
              &quot;DESCRIPTION&quot;: &quot;&quot;,
              &quot;EXPIRE_SEC&quot;: 0,
              &quot;RETRY_SEC&quot;: 0,
              &quot;STATUS&quot;: 1,
              &quot;DOMAIN_DISABLE&quot;: false,
              &quot;LPM_DISPLAYGROUP&quot;: &quot;&quot;,
              &quot;REFRESH_SEC&quot;: 0
          },
          {
              &quot;TYPE&quot;: &quot;slave&quot;,
              &quot;AXFR_IPS&quot;: &quot;none&quot;,
              &quot;DOMAIN&quot;: &quot;domain3.edu&quot;,
              &quot;TTL_SEC&quot;: 0,
              &quot;SOA_EMAIL&quot;: &quot;&quot;,
              &quot;DOMAINID&quot;: 33333,
              &quot;DESCRIPTION&quot;: &quot;&quot;,
              &quot;EXPIRE_SEC&quot;: 0,
              &quot;RETRY_SEC&quot;: 0,
              &quot;STATUS&quot;: 1,
              &quot;DOMAIN_DISABLE&quot;: true,
              &quot;LPM_DISPLAYGROUP&quot;: &quot;&quot;,
              &quot;REFRESH_SEC&quot;: 0
          }
      ],
      &quot;ERRORARRAY&quot;: []
  }
  </code></pre>
  <p>Desired output:</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;ACTION&quot;: &quot;domain.list&quot;,
      &quot;DATA&quot;: [
          {
              &quot;TYPE&quot;: &quot;slave&quot;,
              &quot;AXFR_IPS&quot;: &quot;none&quot;,
              &quot;DOMAIN&quot;: &quot;domain1.com&quot;,
              &quot;TTL_SEC&quot;: 0,
              &quot;SOA_EMAIL&quot;: &quot;&quot;,
              &quot;DOMAINID&quot;: 11111,
              &quot;DESCRIPTION&quot;: &quot;&quot;,
              &quot;EXPIRE_SEC&quot;: 0,
              &quot;RETRY_SEC&quot;: 0,
              &quot;STATUS&quot;: 1,
              &quot;DOMAIN_DISABLE&quot;: true,
              &quot;LPM_DISPLAYGROUP&quot;: &quot;&quot;,
              &quot;REFRESH_SEC&quot;: 0
          },
          {
              &quot;TYPE&quot;: &quot;slave&quot;,
              &quot;AXFR_IPS&quot;: &quot;none&quot;,
              &quot;DOMAIN&quot;: &quot;domain2.net&quot;,
              &quot;TTL_SEC&quot;: 0,
              &quot;SOA_EMAIL&quot;: &quot;&quot;,
              &quot;DOMAINID&quot;: 22222,
              &quot;DESCRIPTION&quot;: &quot;&quot;,
              &quot;EXPIRE_SEC&quot;: 0,
              &quot;RETRY_SEC&quot;: 0,
              &quot;STATUS&quot;: 1,
              &quot;DOMAIN_DISABLE&quot;: false,
              &quot;LPM_DISPLAYGROUP&quot;: &quot;&quot;,
              &quot;REFRESH_SEC&quot;: 0
          },
          {
              &quot;TYPE&quot;: &quot;slave&quot;,
              &quot;AXFR_IPS&quot;: &quot;none&quot;,
              &quot;DOMAIN&quot;: &quot;domain3.edu&quot;,
              &quot;TTL_SEC&quot;: 0,
              &quot;SOA_EMAIL&quot;: &quot;&quot;,
              &quot;DOMAINID&quot;: 33333,
              &quot;DESCRIPTION&quot;: &quot;&quot;,
              &quot;EXPIRE_SEC&quot;: 0,
              &quot;RETRY_SEC&quot;: 0,
              &quot;STATUS&quot;: 1,
              &quot;DOMAIN_DISABLE&quot;: true,
              &quot;LPM_DISPLAYGROUP&quot;: &quot;&quot;,
              &quot;REFRESH_SEC&quot;: 0
          }
      ],
      &quot;ERRORARRAY&quot;: []
  }
  </code></pre>
  <p>what should I change in my jq command?</p>