javascript - Sequelize - Promise.All returning array of undefined -


the following query log out queried results:

    loans.findall({         attributes: option.loanattributes,         include: option.loanincludes       }).then(results => {       console.log(extractquery(results));     }); 

however when wraps within promise.all function, returns array of undefined:

    promise.all([       loans.findall({         attributes: option.loanattributes,         include: option.loanincludes       })     ]).then(results => {       console.log(extractquery(results));     }) 

promise.all(promisearraysizen).then(fulfilledpromisearraysizen)

you have promise array of size 1 return fulfilled promise array of size 1. therefore need check results[0].

promise.all([   loans.findall({     attributes: option.loanattributes,     include: option.loanincludes   }) ]).then(results => {   console.log(extractquery(results[0])) }) 

Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -