title: Loop Sequence break under map function after await
body: <p>I am newbie on Async Await promise approach. Learn very basic part of async &amp; await. I am at situation where I want to execute the task sequentially, Now for this I wrote the Code but there loop will break the sequence. </p>
  
  <p>My Code is this:</p>
  
  <pre><code>const myAsyncFunction = async () =&gt; {
      try {
          let db1Data = await MyCollection1Name.find().exec();
          if (db1Data.length &gt; 0) {
              //Suppose this collection have sector element which is array and have 5 values
              let newData = db1Data[0].sector;
  
              await Promise.all(
                  newData.map(async(x, i) =&gt; {
                      let db2Data = await MyCollection2Name.find().exec();
                      console.log(i)// Here My loop is break. It not print the value in sequential order. Although this will call after await
  
                  })
              )
          }
      } catch (e) {
          console.log(e)
      }
  }
  myAsyncFunction()
  </code></pre>
  
  <p>Can anyone guide me where I am doing mistake??</p>
  
  <p>Any help or suggestions is really appreciate.</p>