Thursday, 15 August 2013

RangeError: Maximum call stack size exceeded Nodejs mongoose

RangeError: Maximum call stack size exceeded Nodejs mongoose

pWanted to test the speed of inserting new documents in the database
mongodb, However, when the amount of insertion is very large, it returns
the following error: RangeError: Maximum call stack size exceeded Can
anyone tell me why I get the message?/p precodevar counters2Schema = new
mongoose.Schema({'_id': ObjectId, 'seq':String}, { versionKey: false,
collection: 'counters' }), var k = 100000; testCUPwrite function (i) {
var MyObjectId = mongoose.Types.ObjectId; MyObjectId = new
MyObjectId(); var counters2Model = new mongoose.model(counters,
counters2Schema); new counters2Model({'seq': MyObjectId}). save ();
console.log ('teste_' + MyObjectId); if (i lt;k) { i + +;
setTimeout (testCUPwrite (i), 1); } } testCUPwrite (0);
/code/pre pThank you/p

No comments:

Post a Comment