title: jq: Cannot index array with string
body: <p>I have the following in a file (which I will call &quot;myfile&quot;):</p>
  <pre><code>[{
      &quot;id&quot;: 123,
      &quot;name&quot;: &quot;John&quot;,
      &quot;aux&quot;: [{
          &quot;abc&quot;: &quot;random&quot;,
          &quot;def&quot;: &quot;I want this&quot;
      }],
      &quot;blah&quot;: 23.11
  }]
  </code></pre>
  <p>I could parse it if the file did not have the first <code>[</code> and last <code>]</code> as follows:</p>
  <pre><code>$ cat myfile | jq -r '.aux[] | .def'
  I want this
  $
  </code></pre>
  <p>but with the <code>[</code> and <code>]</code> I get:</p>
  <pre><code>$ cat myfile | jq -r '.aux[] | .def'
  jq: error: Cannot index array with string
  </code></pre>
  <p>How can I deal with the <code>[</code> and <code>]</code> using jq? (I'm sure I could parse them off with a different tool but I want to learn correct usage of jq.</p>