Sub-Documents / new value fields PHP SDK


I am trying to add a new piece of information to an existing document and I am not sure how to do so, I am not understanding the documentation for it.

SELECT META(bucketname) As Meta FROM bucketname WHERE Meta().id = “’.$key.’”’)
I pull a document and it shows the meta data:

I want to add to this list of meta data with my own field and put, for example, EXP DATE: some value

Im trying to use mutatein and upsert but im not figuring out the path it desires.

Can someone show me a good example of how i could do this and have access to values in couchbase on application side ?


You can find subdocument documentation here:

Here is an example on how to modify meta attributes (XATTRs). Regular attributes are exactly the same but without 'xattr' => true option.

I can help more if you will provide your code example, logs or failure messages.