my code is:
var json = [1,2,3,4,5,6,7,8,9];
async.forEach(json, function (that, callback) {
sqlitedb.run("INSERT INTO mytable (name) VALUES ("+that+")" , function () {
console.log(that); callback();
});
});
The callback() placed on after insert item. but when i execute, my json items inserted on no squence and result is like:
7
8
9
4
5
3
6
1
2
Can anyone help me. Thanks.
ORDER BYclause aren't guaranteed to have any particular ordering anyway.