I’m having trouble while inserting ~2MB document into my collection in meteor. Actually it stuck during insert and neither throwing an error or returning a result.
MongoDB has some hard limits for how big your documents and collections can be. Please refer to the manual and see if that can be your problem.
Also, I see you use schemas for your collection. Its possible that it gets stuck on validating your document against the schema because it’s so big. If that’s the case, you can bypass the validation by calling:
Connections._collection.insert(...);
This will call the MongoDB driver directly bypassing collection2 mechanisms for cleaning and validating your document.
Glad it helped . Keep in mind though that you’re essentially throwing most of the benefits of having a schema if you do inserts that way, so use this only if it’s absolutely neccesary.