10334: BSONObjectTooLarge
MongoDBWhat does it mean?
A BSON document exceeded the maximum allowed size (16 MB). MongoDB cannot store or return a single document above this limit.
Why does it happen?
Exceeding the 16 MB limit by continuously appending data/array elements to a document, very large embedded arrays, huge documents produced by an aggregation, or large binary data stored directly in the document.
How to fix it
Review the data model: split large arrays into separate collections and use a referencing model. Use GridFS for large binary files. Bound unbounded arrays (e.g. the capped/bucket pattern). Keep document size under control in aggregation stages.