title: How to merge child object with Parent object when used in async/await
body: <p>I want to merge child Object <strong>rawData</strong> with parent, I used below code and it works perfectly fine.</p>
  <p>But the issue arises when I fetch from MongoDB &amp; use it using async/await, it doesn't and return only the same original source as output.
  Not sure what I am doing wrong.</p>
  <pre><code>var source = await Project.find({})
  </code></pre>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var source = [
      {
          "_id": "5f6b3f9c24b38656ec43ui38",
          "Term": "Term B",
          
          "rawData": {
              "Plants1_growTime": 0,
              "Plants1_sunTime": 10,
          }
      },
      {
          "_id": "5f508e8427e8824ad8f055dd",
          "Term": "Term B",
          "rawData": {
              "Plants1_growTime": 34,
              "Plants1_sunTime": 65,
          }
      }
  ]
  
   source.forEach(function (item) {
      var rawData = item.rawData;
      delete item.rawData;
      for (var property in rawData) {
        item[property] = rawData[property];
      }
    });
    
    console.log(source);</code></pre>
  </div>
  </div>
  </p>
  <p><a href="https://i.stack.imgur.com/QdoO2.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QdoO2.jpg" alt="enter image description here" /></a></p>