Is there a way to get updated nested document

Hi there,

I am wondering if there is a way to return an updated object after an update.

As an example, I could make an update whith this kind of request :

UPDATE default d
SET c.arrayObjLvl2 = ARRAY_APPEND( IFMISSING(c.arrayObj, []), 
                { 'objectLvl2Id': 'objectLvl2::1',
                  'name': 'Object'
FOR c IN d.arrayObjLvl1 WHEN c.objLvl1 = 'objLvl1::1' END RETURNING d.*;

In this example, I would like to get as result the object I have successfully added. I don’t know the path of the object so I cannot replace d.* by d.arrayObjLvl1[x] etc…

Is someone have an idea ?

See RETURNING clause in documentation.

@prasad, @amarantha @keshav_m we need more content on the UPDATE page. The INSERT page is great.

It seems it is not possible if we do not know the path.

UPDATE my_bucket AS doc
SET ...

Hi, I have already found the way to get the document updated, what I was looking for was to get a nested document. In my example only the array arrayObjLvl2.

I don’t know if I am understandable.

At this time, I havent found a way to do this.

If you do not know the path to return, how will you decide what to return?