Maximum call stack size exceeded on insert 10000 documents

后端 未结 2 1343
后悔当初
后悔当初 2021-01-07 15:00

This is the code am running which returns the Range Maximum call stack size exceeded error. // to insert 10000 values on to mongodb using node.js

                    


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-07 15:36

    Looping over 10000 times and performing insert is really a bad idea. But still you can do with async library which might help you fix the issue. I have came across this situation before and i used async.queue to overcome the issue.

    Async.js module.

提交回复
热议问题