I've an promise object that result from sequelize findAll, I tried to loop the data using map
but it doesn't work like I need. Here the example of my code:
const list = await queueProcess.findAll({
where: {
id: {[Op.between]: [start, end]},
is_active: true
},
attributes: ['id', 'param_value']
});
await Promise.all(
list.map(async (e) => {
console.log("Promise");
const check = await checkProcess(e.id);
})
)
this is another function from another file:
checkProcess: async (id) =>{
console.log("Check");
}
it give me result:
Promise
Promise
Check
Check
and what I need is
Promise
Check
Promise
Check
Why does this happen? I thought that my code is appropriate, and can work asyncly.