这是正确的做法吗?
我也对最终对象感兴趣 - bigMap,如何检索它?
var query1 = connection.query('SELECT * FROM posts');
bigMap={}
query1
.on('result', function(row) {
processRow(row[pKey], function(map) {
bigMap=Object.assign(bigMap,map )
});
})
processRow(fKey, function(cb) {
var query2 = connection.query('SELECT * FROM comments WHERE field='+fKey+';');
var map={}
query2
.on('result', function(row) {
map[row[something]]=row[somethingElse]
})
.on('end', function(row) {
cb(map);
})
});