title: Filer an array of objects with yq
body: <p>I have a yaml file that looks like this:</p>
  <pre><code>apiVersion: v1
  entries:
    blue-green-toggle:
    - description: Used to toggle an application between blue and green
      name: blue-green-toggle
      version: 1.0.17
      apiVersion: v2
    - description: Used to toggle an application between blue and green
      name: blue-green-toggle
      version: 1.0.16
      apiVersion: v2
    - description: Used to toggle an application between blue and green
      name: blue-green-toggle
      version: 1.0.15
      apiVersion: v2
    istio-config:
    - description: Used to configure the cluster level settings of istio.
      name: istio-config
      version: 1.0.4
      apiVersion: v2
    - description: Used to configure the cluster level settings of istio.
      name: istio-config
      version: 1.0.1
      apiVersion: v2
    latest-toggle:
      name: latest-toggle
      version: 1.0.5
      apiVersion: v2
    standard-helm-chart:
      name: standard-helm-chart
      version: 1.1.10
      apiVersion: v2
      name: standard-helm-chart
      version: 2.0.1
      apiVersion: v2
      name: standard-helm-chart
      version: 1.0.34
      apiVersion: v2
      name: standard-helm-chart
      version: 1.0.10
      apiVersion: v2
      name: standard-helm-chart
      version: 1.0.9
      apiVersion: v2
  generated: 2021-06-22T00:22:33.1554922Z
  ...
  </code></pre>
  <p>I am trying to list the the <code>version</code> numbers that start with <code>1.0.</code> and are listed in the <code>standard-helm-chart</code> section.</p>
  <p>I have used this so far to get just the entries for the <code>standard-helm-chart</code>:</p>
  <pre><code>yq eval '.entries | .standard-arup-helm-chart' index.yaml
  </code></pre>
  <p>That worked fine.  So then I then tried to get just to the rows with <code>version</code> matching <code>1.0.*</code>.  I read over the <a href="https://mikefarah.gitbook.io/yq/operators/select" rel="nofollow noreferrer">select documentation</a> for <code>yq</code>, but it does not indicate how to match when you are looking at an object instead of just a string.</p>
  <p>I tried this:</p>
  <pre><code>yq eval '.entries | .standard-arup-helm-chart | select(. == &quot;1.0.*&quot;)' index.yaml
  </code></pre>
  <p>But this fails.  And I would expect it to, because it can't compare the string of &quot;1.0.*&quot; to the whole object.</p>
  <p>I also tried:</p>
  <pre><code>yq eval '.entries | .standard-arup-helm-chart | select(.version == &quot;1.0.*&quot;)' index.yaml
  </code></pre>
  <p>Thinking that would let <code>yq</code> know that I want to just look at the version.  But it said <code>Error: Cannot index array with 'version'</code></p>
  <p>I then figured I needed to try an array style syntax:</p>
  <pre><code>yq eval '.entries | .standard-arup-helm-chart | select(.[version] == &quot;1.0.*&quot;)' index.yaml
  </code></pre>
  <p>But that fails with a parsing error.</p>
  <p><strong>What command can I send <code>yq</code> to get all the version numbers that start with <code>1.0.</code>?</strong></p>