title: I want to replace the data in json array and convert it to json
body: <p>I have the json data in array.</p>
  <pre><code>
      var obj = [
              {
                  student_data:{
                      name: 'brj',
                      id: '123',
                      marks:[{'hi': 12, 'mt': 20, 'en': 20}]
                  }
              },
              {
                  student_data:{
                      name: 'anand',
                      id: '124',
                      marks:[{'hi': 12, 'mt': 20, 'en': 20}]
                  }
          
              }
          ]
  
  </code></pre>
  <p>here i want to replace <code>student_data</code> with their respective <code>ids</code>, and convert this array to json string. Also i would like to remove some of the fields like <code>id</code> which we are have used already in place of <code>student_data</code>. the output should look like</p>
  <pre><code>
              
  
               {
                  '123':{
                      name: 'brj',
                      
                      marks:[{'hi': 12, 'mt': 20, 'en': 20}]
                  }
              },
              {
                  '124':{
                      name: 'anand',
                      
                      marks:[{'hi': 12, 'mt': 20, 'en': 20}]
                  }
  
              }
  
  </code></pre>