title: RangeError: Maximum call stack size exceeded Nodejs mongoose
body: <p>Wanted 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>
  
  <pre><code>var 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>
  
  <p>Thank you</p>