I m actually facing a problem when trying to get a full resultset (~40 result). Each object has ~260 childs references and other objects packed in.
Actually, when I try to display 30 objects, it works. But when I try with 40 it doesn't. Each object is correct, no data is invalid.
It seems that I've exceed the maximum size(4 or 16 mb) authorized by mongoDb or defaultly Mongoskin (the library that I use to access mongodb), and mongodb close the pool connection to my application.
So how can I increase the maximum document size, or the maximum result set size, to display everything I need ?
EDIT : My collection size is 8Mb (from MongoVue informations)
EDIT 2 : The code I use to get my data :
db.collection("roadmap").find({}).toArray()
An screenshot of my db :
EDIT 3 : I changed the way I was exploiting my data using
@em.collection('roadmap').find({}, (err, resultCursor)=>
nextItem = (err, item)=>
if !item)
return
console.log item
resultCursor.nextObject(nextItem)
resultCursor.nextObject(nextItem)
)
It doesn't work neither, the request is executed, and then, I lose my mongodb connection. If I comment this piece of code in my application, all is working great.
EDIT 4 : Full stack trace, it's more a library problem than a db problem
Error: parseError occured
at [object Object].<anonymous> (/var/www/xxxxxx/Ws/node_modules/mongoskin/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:192:34)
at [object Object].emit (events.js:98:17)
at Socket.<anonymous> (/var/www/xxxxxx/Ws/node_modules/mongoskin/node_modules/mongodb/lib/mongodb/connection/connection.js:393:20)
at Socket.emit (events.js:95:17)
at Socket.<anonymous> (_stream_readable.js:764:14)
at Socket.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:426:10)
at emitReadable (_stream_readable.js:422:5)
at readableAddChunk (_stream_readable.js:165:9)
at Socket.Readable.push (_stream_readable.js:127:10)
I would suggest you to Create and index for the collection 'roadmap'.
This is just used to retrive data faster than before, refer http://docs.mongodb.org/manual/core/indexes-introduction/
Change the Find as follows, there is no need of toArray function since the data is already an array.
This finds all the data in the roadmap collection.The index is used when the data set is huge. Hope this helps.