Using jq to fetch key value from json output : <p>I have a file that looks as below:</p>

<pre><code>{
  "repositories": [
   {
    "id": "156c48fc-f208-43e8-a631-4d12deb89fa4",
    "namespace": "rhel12",
    "namespaceType": "organization",
    "name": "rhel6.6",
    "shortDescription": "",
    "visibility": "public"
   },
   {
    "id": "f359b5d2-cb3a-4bb3-8aff-d879d51f1a04",
    "namespace": "rhel12",
    "namespaceType": "organization",
    "name": "rhel7",
    "shortDescription": "",
    "visibility": "public"
   }
  ]
 }
</code></pre>

<p>I want to get only name values with each of them in a new line so that I can use <code>while read -r line</code>.
I need only </p>

<pre><code>rhel6.6 
rhel7
</code></pre>

<p>I am using jq as follows which doesn't seem to work:</p>

<pre><code>jq -r '.[].name'
</code></pre>

<p>Please suggest correct use of jq here</p>
