title: Async/await with function push not working
body: <p>I have a problem with <code>async - await</code>.</p>
  
  <p>What is happening?</p>
  
  <p>I have a function of callback that a sends an array of objects, with valid objects and invalid objects to other function.</p>
  
  <p>In the function, I do the validation, if it is valid, and do a <code>push</code> to save it in an array.</p>
  
  <p>And I want to pass it to another function JUST when it finalizes with all objects valid. But it passes one per one and not all.</p>
  
  <p>Someone could help me ?</p>
  
  <p>Function that I call the callback passing the array of objects valid or not:
  <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>const getNewNotification = async (callback) =&gt; {
    await pool.query('SELECT * from alerts', (err, res) =&gt; {
      if (err) {
        console.log(err)
      } else {
        const newsNotification = res.rows;
        callback(newsNotification)
      }
    })
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Function that I make the <code>push</code>:</p>
  
  <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>const sendNotification = async (notification, callback) =&gt; {
    let domain;
    let subdomain;
    let name;
    let userHistory;
    let userDescription;
    let sequenceHistory;
  
    let personYes = [];
  
    let person;
    await notification.map(async (user) =&gt; {
      // VERIFY IF THE OBJECT IS VALID
      await pool.query(`SELECT * from wfm where mail = '${user.id}''`, async (err, res) =&gt; {
        if (res.rows.length !== 0) {
          person = {
            domain: res.rows[0].domain_name,
            subdomain: res.rows[0].subdomain_name,
            name: res.rows[0].name,
            userHistory: user.id,
            userDescription: user.change_description,
            sequenceHistory: user.sequence,
          }
    
    // MAKE THE PUSH...
          await personYes.push(person);
  callback2(personYes);
        }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Basically, i want that the function <code>sendNotification</code> send the data JUST  when it to end, how i make it?</p>