Node JS: How to Promise For Loop
问题 I'm trying to create a NodeJS app. Below is code that is supposed to be called when an admin creates a new product. Most of the code works, but I'm having trouble rendering the view only after the rest of the code has executed (the DB functions are asynchronous). I've wrapped much of the code in promises (to make certain blocks execute in the right order) and console logs (to pinpoint problems). I'd like to point out that the console.dir(rejProducts) just below console.log(111) logs and empty