I'm using NodeJS. I want to do something to 1,000,000 rows without loading all the rows into the memory. (for-each)
Before, when I used ASP Classic I did:
do while not rec.eof
//do something
rec.movenext
loop
In node-mysql I didn't found anything that similar to cursor. only
connection.query('select * from bigdata',function(err,rows))
The problem is, that I don't want to loads all the rows at one time.
I found an answer, and put it below. I keep the question to help others who will have the same question