title: Using jq, convert array of objects to object with named keys
body: <p>Given a json file in the format as :</p>
  
  <pre><code>[
   {
    name : "A",
    value : "1"
   },
   {
    name : "B",
    value : "5"
   },
   {
    name : "E",
    value : "8"
   }
  ]
  </code></pre>
  
  <p>How would I convert it to something like this using jq:</p>
  
  <pre><code>{
   "A" : {
     name : "A",
     value : "1"
   },
   "B" : {
    name : "B",
    value : "5"
   },
   "E" : {
    name : "E",
    value : "8"
   }
  }
  </code></pre>
  
  <p><code>jq '{(.[].name) : "the name"}' 'myfile.json'</code> gets me an object with [].name keys but how do I assign the object to it?</p>