i want to ask about mongodb document design
I have document with structure like this
{
_id:123,
data:[
[
{ name: "andy" }, ....
],
[
{ price : 1000 }, ....
],
.....
]}
i put 1 transaction into 1 document, so easy to manage data. But i have an issue when there are many data inside array, when it exceed 16mb..
I dont want to change or split the data into many document, because my application already depends on its index in data array, if i do, its painfull in application side..
Since i'm using aggregation (pagination , project), there are no performance issue when it comes to data retrieving.
I know split data into new document can solve this problem, i just only add a field reference into new document.
But if i dont want to split the document, is it posibble?
In mongodb, A document size can not be exceed 16 mb. So you can simply split the document into parts. and when you are going to access that from the back end, you can unite using aggregation pipeline. You may use "allowDiskUse" feature for this.