I have 2 nested async.each. They look like:
async.each(result, function(row, callbackrow) {
tot = 0;
console.log('UID:', row.uid);
async.each(row.vbs, function(vb, callback){
checkInteractions(row.uid, vb.vbNID, function(data){
console.log(data);
callback();
});
}, function(err){ console.log('done 1'); });
callbackrow();
}, function(err){ console.log("done all"); });
My problem is, the checkinteraction async call causes problems. Without it, console logs are called from second each for each one of the first async each. With it, I get the done all message, and after the nested (second) async each executes its code. I need it to be like a synchronus call of a for inside a for. For each element of first for, the second one to be executed before stepping to next index in the first for.