Hi,
When I was researching the issue I faced with with the Node 2.0 documentation. This guide says the following sentence at the Atomic Operation chapter.
This operation is performed without any consideration for data type, thus appending a JSON document to a JSON document will result in an invalid object (for instance: {}{}).
For this reason I think the Couchbase server stores documents like indexed-db. Several fields for meta data and another field for main JSON data. Is it true ?
_id | meta1 | main data
an_Id_3XYZ rev_08DO01546 { JSON }
I’ll make a decision regarding to store all user data (puschased product, billing information, messages etc.) into a document. For this reason I think my document size will be increased up to 10 mb in time. At the same time I cannot get and put the entire of document when a user use the application.
If I use that way, can I insert/update partial data (in fact working an embedded document) into a Couchbase document ?
I’ve wrote the below for the sake of example. Can I insert a new item or update a current item in the purchased array field ?
{
_id: "1",
username: "cody",
address: { street: "A Street", postalCode: "34349", city: "A City", province: "A Province" },
purchased: [{ _id: 1, title:"Lawn chair",
content: "Green color",
image: "../images/products/img1.jpg",
date: "2014-10-24T14:57:28.348Z"
},
{ _id: 2, title:"Space Truck",
content: "1365 PS with Turbo",
image: "../images/products/img59.jpg",
date: "2014-10-24T14:57:28.348Z"
}],
}