Could not get this to work.  The element to be inserted was not reachable by the db:add or the generated id was not reachable by the db:ouput. 

Wray Johnson
(m) 704-293-9008

On Nov 18, 2017, at 4:00 AM, Christian GrĂ¼n <christian.gruen@gmail.com> wrote:

You might want to try db:output. See our documentation on performing returning updates and returning output.



Am 18.11.2017 01:44 schrieb "E. Wray Johnson" <wray.johnson@gmail.com>:
How can I white a single XQUERY statement that assigns an auto-generated id to a node (using either generate-id(), or random:uuid() ) then inserts the node into a database and then returns the auto-generated id.

I can do the id assignment and insert operation just fine using { }, I just don't know how to return the id afterward