title: How to modify the JSON data using RapidJSON by modifying it to a different schema
body: <p>I have to modify a JSON data to a different schema using RapidJson. I can modify a Value objects name and value but I could not find the right examples so that I can modify the JSON by rearranging the nodes.</p>
  
  <p>I tried by creating a new document and adding the Value taken from the other document but it is not working.</p>
  
  <pre><code>    rapidjson::Document doc1, doc2;
              rapidjson::Document::AllocatorType&amp; alloc = doc1.GetAllocator();
              doc1.Parse(str); // str contains the JSON data
  
              Value statusObj(doc1["status"], alloc);
              Value resultsObj(doc1["area_data"]["update_results"], alloc);
  
              doc2.SetObject();
              doc2.AddMember("status", statusObj, alloc);
              doc2.AddMember("results", resultsObj, alloc);
  
  //doc1 - This is the inout JSON
  {
      "status": {},
      "area_data":
      {
          ""
          "update_results":[]
      }
  }
  
  //doc2 - This is what am trying to create
  {
      "status": {},
      "results":[]    //update_results from doc 1
  }
  </code></pre>