title: merge child object in parent object in API
body: <p>I have to combine all data in a single object. I have an array of objects, each of which have an embedded object, for instance:</p>
  <pre><code>[
    {
      robots: [],
      lines: [],
      _id: 5f753118391fe067dcfa1c88,
      shift: 'Shift A',
      date: 2020-10-01T00:00:00.000Z,
      rawData: {
        robot1_runTime: 4989,
        robot2_runTime: 6956,
        robot2_waitTime: 6944,
      },
      createdAt: 2020-10-01T01:30:00.918Z,
      updatedAt: 2020-10-01T02:47:22.107Z,
      __v: 0
    },
   {
      robots: [],
      lines: [],
      _id: 5f753118391fe067dcfa1c88,
      shift: 'Shift A',
      date: 2020-10-01T00:00:00.000Z,
      rawData: {
        robot1_runTime: 4989,
        robot2_runTime: 6956,
        robot2_waitTime: 6944,
      },
      createdAt: 2020-10-01T01:30:00.918Z,
      updatedAt: 2020-10-01T02:47:22.107Z,
      __v: 0
    }
  ]
  </code></pre>
  <p><strong>And I have to merge the fields in the embedded object <code>rawData</code> into the parent object like so:</strong></p>
  <pre><code>[
    {
      robots: [],
      lines: [],
      _id: 5f753118391fe067dcfa1c88,
      shift: 'Shift A',
      date: 2020-10-01T00:00:00.000Z,
      robot1_runTime: 4989,
      robot2_runTime: 6956,
      robot2_waitTime: 6944,
      createdAt: 2020-10-01T01:30:00.918Z,
      updatedAt: 2020-10-01T02:47:22.107Z,
      __v: 0
    },
   {
      robots: [],
      lines: [],
      _id: 5f753118391fe067dcfa1c88,
      shift: 'Shift A',
      date: 2020-10-01T00:00:00.000Z,
      robot1_runTime: 4989,
      robot2_runTime: 6956,
      robot2_waitTime: 6944,
      createdAt: 2020-10-01T01:30:00.918Z,
      updatedAt: 2020-10-01T02:47:22.107Z,
      __v: 0
    }
  ] 
  </code></pre>
  <p>Each field in the <code>rawData</code> embedded object should be a field in the outer object, eliminating the embedded object altogether.
  Can anybody tell me how I can implement that so I can give API to another team?</p>