Im a newbie in nodejs and mongodb. I have a problem when i read about 100000 records from my mongodb in nodejs application. When I try to get 100000 records, I got this erro
Use node --max_old_space_size=5000 yourapp.js
to allow 5000 mb. Look in your eclipse launch settings for command-line parameters, where you can add this.
However, as the comments say, you should reconsider loading this into memory, and stream it to the client instead.
you could add the following to your package.json
"scripts": {
"start": "node --max-old-space-size=102400 ./app.js",
......
}
this is unlike the other way has to write only once and configured each run time. Note: you no need to run explicitly this command the npm start will take care of configuring it each time