Change how document size is calculated
Disclaimer: I'm aware that this is a pretty big feature request.
Currently a document has a max size of 16 mb. I'm not suggesting changing that. However, I'm suggesting changing how that size is calculated.
I'm designing a database in which documents have a tree structure. The document will have an array called "nodes", which can hold any number of child nodes. Those nodes can also have arrays of nodes, and so on. It's a simple tree structure.
For major users of my application, that outer document could get pretty big. It's not a problem right now (no users, no problems) but if my app goes big time I'd have to do a major overhaul to how I structure those hierarchies. Yes, I could design it like that from the get go, but the hierarchical structure is so easy and simple that, for now, I'm going with it.
Now, here's what I'm proposing:
Instead of internally storing each hash as a structure within a document or within another hash, store it as a reference to that hash. To the programmer it would look the same. However, the size of the document would only be based on the sizes of the references to the hashes, not the size of the hashes themselves. So the document, and its nested hashes, does not contain all the nested hashes, but only the their references. The document could be effectively much bigger because references don't take up much space.
I throw the topic out for discussion.