title: Update nested array value in yaml with yq
body: <p>Given a yaml file (helmfile) like the following</p>
  
  <pre><code>releases:
    - chart: ../charts/foo
      name: foo
      namespace: '{{ .Values.stack }}'
      values:
        - ../config/templates/foo-values.yaml.gotmpl
      set:
        - name: image.tag
          value: 22
        - name: replicas
          value: 1
    - chart: ../charts/bar
      name: bar
      namespace: '{{ .Values.stack }}'
      values:
        - ../config/templates/bar-values.yaml.gotmpl
      set:
        - name: image.bar_proxy.tag
          value: 46
        - name: image.bar.tag
          value: 29
        - name: replicas
          value: 1
  </code></pre>
  
  <p>I'm trying to figure out a clean way to update a specific image tag. For example, I'd like to update <code>image.bar_proxy.tag</code> from <code>46</code> to <code>51</code>.</p>
  
  <p>I have the following, which does the job, but it requires that you know the exact index of the array item:</p>
  
  <pre><code>yq -y '.releases[] |= if .name=="bar" then .set[0].value |= 51 else . end' helmfile-example.yaml
  </code></pre>
  
  <p>So if the array order were to change at some point this would break.</p>
  
  <p>A preferred solution would be: "update image.bar_proxy.tag value from <code>46</code> to <code>51</code> where set[].name==image.bar_proxy.tag". Any ideas on how to achieve a more specific conditional selection like this?</p>
  
  <p>FYI our yq version:</p>
  
  <pre><code>$ yq --version
  yq 2.10.0
  </code></pre>