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
Post a Comment