jq select value from array
<p>I have the following JSON file with example values:</p>

<pre><code>{
    "files": [{
        "fileName": "FOO",
        "md5": "blablabla"
    }, {
        "fileName": "BAR",
        "md5": "alaldlafj"
    }]
}
</code></pre>

<p>Now what I want is to return the md5 value where for example the fileName is "FOO". For this I have the following statement in <code>jq</code>:</p>

<pre><code>cat &lt;file&gt;.json | jq '.[] | select(.fileName=="FOO")' 
</code></pre>

<p>However response back is: <code>jq: error (at &lt;stdin&gt;:11): Cannot index array with string "fileName"</code></p>

<p>What is the correct way to return the md5 value where the key fileName equals a certain argument?</p>