title: jq: get first n elements of an array field
body: <p>I'm getting some issues trying to get only firsts 3 elements of an array:</p>
  <p>json is like this:</p>
  <pre class="lang-json prettyprint-override"><code>{
     &quot;resourceType&quot;:&quot;Practitioner&quot;,
     &quot;id&quot;:&quot;328001&quot;,
     &quot;meta&quot;:{
        &quot;versionId&quot;:&quot;1&quot;,
        &quot;lastUpdated&quot;:&quot;2021-11-08T12:47:51.239+01:00&quot;,
        &quot;source&quot;:&quot;#BUkX5uagwf3PcHzd&quot;
     },
     &quot;identifier&quot;:[
        {
           &quot;use&quot;:&quot;official&quot;,
           &quot;system&quot;:&quot;urn:oid:1.3.6.1.4.1.19126.3&quot;,
           &quot;value&quot;:&quot;00396185X&quot;
        },
        {
           &quot;use&quot;:&quot;official&quot;,
           &quot;system&quot;:&quot;urn:oid:2.16.724.4.9.10.2&quot;,
           &quot;value&quot;:&quot;0831515&quot;
        },
        {
           &quot;use&quot;:&quot;official&quot;,
           &quot;system&quot;:&quot;urn:oid:2.16.724.4.9.10.2&quot;,
           &quot;value&quot;:&quot;0831515&quot;
        },
        {
           &quot;use&quot;:&quot;official&quot;,
           &quot;system&quot;:&quot;urn:oid:2.16.724.4.9.10.2&quot;,
           &quot;value&quot;:&quot;0831515&quot;
        }
     ],
     &quot;active&quot;:true,
     &quot;name&quot;:[
        {
           &quot;use&quot;:&quot;official&quot;,
           &quot;text&quot;:&quot;JULIAN RODRIGUEZ LARREA&quot;,
           &quot;family&quot;:&quot;RODRIGUEZ&quot;,
           &quot;_family&quot;:{
              &quot;extension&quot;:[
                 {
                    &quot;url&quot;:&quot;http://hl7.org/fhir/StructureDefinition/humanname-mothers-family&quot;,
                    &quot;valueString&quot;:&quot;LARREA&quot;
                 }
              ]
           },
           &quot;given&quot;:[
              &quot;JULIAN&quot;
           ]
        }
     ],
     &quot;qualification&quot;:[
        {
           &quot;code&quot;:{
              &quot;coding&quot;:[
                 {
                    &quot;system&quot;:&quot;urn:oid:2.16.840.1.113883.6.96&quot;,
                    &quot;code&quot;:&quot;62247001&quot;
                 }
              ]
           }
        }
     ]
  }
  </code></pre>
  <p>Is there any way to get only first 3 elements od <code>.identifier</code>?</p>
  <pre><code>jq -r '(.identifier[] | .system, .value)'
  </code></pre>
  <p>Any ideas?</p>