title: Parse an array of json object using jq
body: <p>I am trying to parse the below json file and store the result into another json file. How do I achieve this ?</p>
  <pre><code>{
    &quot;Objects&quot;: [
      {
        &quot;ElementName&quot;: &quot;Test1&quot;,
        &quot;ElementArray&quot;: [&quot;abc&quot;,&quot;bcd&quot;],
        &quot;ElementUnit&quot;: &quot;4&quot;
      },
      {
        &quot;ElementName&quot;: &quot;Test2&quot;,
        &quot;ElementArray&quot;: [&quot;abc&quot;,&quot;bcde&quot;],
        &quot;ElementUnit&quot;: &quot;8&quot;
      }
    ]
  }
  </code></pre>
  <p>Expected result :</p>
  <pre><code>{
  &quot;Test1&quot; :[
  &quot;abc&quot;,&quot;bcd&quot;
  ],
  &quot;Test2&quot; :[
  &quot;abc&quot;,&quot;bcde&quot;
  ]
  }
  
  </code></pre>
  <p>I've tried something on the lines of the below but I seem to be off -</p>
  <pre><code>jq '[.Objects[].ElementName ,(.Objects[]. ElementArray[])]' user1.json
  
  jq &quot;.Objects[].ElementName .Objects[].ElementArray&quot; ruser1.json
  </code></pre>