Answer the question
In order to leave comments, you need to log in
Is it possible to send asynchronous requests in a loop?
rows.forEach(function(row, i, arr){
connection.query("INSERT INTO ....+ row + " , function(err) {
if(err) console.log(err);
});
})
Answer the question
In order to leave comments, you need to log in
1. Yes, you can do it
2. Wrap asynchrony in promises and then catch from all
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question