I cannot get db:output to work.
Error is [XPST0008] Undefined variable $c for the following sample code:

copy $c := element test { element id { }}
modify (
  replace value of node $c/id with generate-id($c)
)
return db:output ($c/id), insert node $c into db:open('sample', 'tests')

On Sat, 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