Skip to content

Instantly share code, notes, and snippets.

@ableasdale
Created December 11, 2020 09:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ableasdale/9644312737237c1ef497be907cc1744b to your computer and use it in GitHub Desktop.
Save ableasdale/9644312737237c1ef497be907cc1744b to your computer and use it in GitHub Desktop.
MarkLogic: In Forest Eval - adding xdmp:document-assign back into the evaluation
let $forest :=
let $forests := xdmp:database-forests(xdmp:database())
let $index := xdmp:document-assign("document-1.xml", count($forests))
return $forests[$index]
return local:in-forest-eval("xdmp:document-insert('/foo1.xml', <foo>1</foo>)", (), xs:unsignedLong($forest))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment