title: How to return multiple Promises within an array in sequelize?
body: <p>I'm currently trying to run multiple queries within Sequelize and return an array of promises back to where the function was called. How do I return the array with the promises back to the function as a promise so that it can be resolved later on?</p>
  
  <p>Function calling the query:</p>
  
  <pre><code>router.get('/barchart', (req, res) =&gt; {
    store.getBarchartData().then(session =&gt; {
      res.json(session);
    })
  })
  </code></pre>
  
  <p>Query function:</p>
  
  <pre><code>getBarchartData(data) {
      let promises = [];
      let curr = new Date();
      let start = startOfWeek(curr);
      let date = start.getDate();
      let month = start.getMonth() + 1;
      let year = start.getFullYear();
      let startDateString = year + "-" + month + "-" + date;
      let queryDate;
  
  
  
       for(i = 0; i &lt; 5; i++) {
            startDateString = addDays(startDateString, 1);
            queryDate = format(startDateString, 'YYYY-MM-DD');
            promises.push(models.session.findAll({
              where: { date: { [Op.eq]: queryDate }  },
              attributes: [[Sequelize.fn('COUNT', Sequelize.col('id')), 'y']]
            }))
          }
          console.log(promises);
          return Promise.all(promises);
        }
  </code></pre>
  
  <p>When the query is run it returns an array of promises seen below which I want to return back to the other function:</p>
  
  <pre><code>[ Promise {
      _bitField: 0,
      _fulfillmentHandler0: undefined,
      _rejectionHandler0: undefined,
      _promise0: undefined,
      _receiver0: undefined },
    Promise {
      _bitField: 0,
      _fulfillmentHandler0: undefined,
      _rejectionHandler0: undefined,
      _promise0: undefined,
      _receiver0: undefined },
    Promise {
      _bitField: 0,
      _fulfillmentHandler0: undefined,
      _rejectionHandler0: undefined,
      _promise0: undefined,
      _receiver0: undefined },
    Promise {
      _bitField: 0,
      _fulfillmentHandler0: undefined,
      _rejectionHandler0: undefined,
      _promise0: undefined,
      _receiver0: undefined },
    Promise {
      _bitField: 0,
      _fulfillmentHandler0: undefined,
      _rejectionHandler0: undefined,
      _promise0: undefined,
      _receiver0: undefined } ]
  </code></pre>