title: Nested async await not working as expected
body: <p>I'm trying to add a table in my existing code for some data and for this i have setted up everything similar to what mentioned in the exceljs docs. Here is a code snippet of the condition where i'm trying to get the data i need in order to get the table. When i'm printing the modRows within the forEach, it's showing the data but when i'm printing it outside the loop it's getting blank. Is there any way or other workaround to this? Is it possible to have async within async?</p>
  <pre><code>const generateCatReports = async (mode = 'monthly', months = 1, toDate = false) =&gt; {
    if (!['monthly', 'weekly'].includes(mode)) {
      throw new Error(InvalidParamsError);
    }
   const sortedTRIds = obtainSortedCentreIds(studiesTRMap, centreNameIDMap);
    const modRows = [];
    sortedTRIds.forEach(async (trId) =&gt; {
      console.log(&quot;trid&quot;,trId);
      const statsParams = {
        catId: trId,
        createdAt,
      };
      const statsPipeline = studiesStatsPipeline(statsParams, capitalize(mode));
      const statsInfo = await StudyModel.aggregate(statsPipeline).allowDiskUse(true).exec();
      Object.entries(statsInfo[0]).slice(1).forEach(([key, val]) =&gt; {
        modRows.push([key, val]);
      });
      console.log(&quot;inside sortedTr loop&gt;&gt;&gt;&gt;&gt;&quot; ,modRows);
    });
    console.log(&quot;outside sortedTr loop&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&quot;,modRows);
  
  }
  </code></pre>
  <p>Result:</p>
  <pre><code>trId 1cf1eb1324322bbebe
  inside sortedTr loop&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
  ['TOTAL', 10]
  ['white', 5]
  ['black', 5]
  
  trId 1cf1eb1324322bbebe
  inside sortedTr loop&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
  ['TOTAL', 10]
  ['white', 5]
  ['black', 5]
  
  trId 21e1eb21322bbebe
  inside sortedTr loop&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
  ['TOTAL', 8]
  ['white', 6]
  ['black', 2]
  
  outside sortedTr loop&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;
  []
  </code></pre>