In all tutorials I searched the web, they print the rows/result using console.log the from the mysql query. In my case, I want to store that value to manipulate it in a function. The problem is that node doesn't wait. Can you help me in catching the rows in such example? How can I store the rows in a variable?
con.connect(function (err) {
if (err) throw err;
con.query("SELECT * FROM customers", function (err, result) {
if (err) throw err;
console.log(result);
});
});
I tested one of the solutions but I got [] when trying to get result/rows out of the function. I want to use the result in the savedServices: [] see below:

asyncmodule