Skip to content

Instantly share code, notes, and snippets.

@iamruinous
Last active December 9, 2015 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iamruinous/d9c3df9faaac368659cd to your computer and use it in GitHub Desktop.
Save iamruinous/d9c3df9faaac368659cd to your computer and use it in GitHub Desktop.
mongodb-core RangeError: Maximum call stack size exceeded
var async, col, conn, max, mongojs;
async = require('async');
mongojs = require('mongojs');
max = 1000;
conn = mongojs("localhost/testmeout");
col = conn.collection('tests');
async.times(max, function(i, next) {
return col.insert({
foo: "bar " + i
}, next);
}, function() {
return col.find({}, function(error, data) {
if (error != null) {
console.error(error.stack);
}
return console.log(data);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment