카테고리 없음
async / await 주의
밍꿔
2020. 11. 12. 13:22
반응형
User.findAndCountAll({where:{"USER_ID":param.user_id}}).then(async (result) => {
for await (const dtResult of result.rows) {
let user_id = dtResult.USER_ID;
let mongoUserScriptInfo = await mongoUserScript.find({"USER_ID":user_id});
}
});
then에 async, for문에 await (순서 보장을 위함)
반응형