I am executing below xquery to ingest a unitemporal file in a temporal collection which lies under a MarkLogic database- Schemas. I am getting below error
Xquery which I am running
xquery version "1.0-ml";
import module namespace temporal = "http://marklogic.com/xdmp/temporal"
at "/MarkLogic/temporal.xqy";
let $root :=
<tempdoc>
<content>v1-content here</content>
</tempdoc>
let $options :=
<options xmlns="xdmp:document-insert">
<metadata>
<map:map xmlns:map="http://marklogic.com/xdmp/map">
<map:entry key="systemStart">
<map:value>2014-04-03T11:00:00</map:value>
</map:entry>
<map:entry key="systemEnd">
<map:value>2014-04-03T16:00:00</map:value>
</map:entry>
</map:map>
</metadata>
</options>
return
Error:
[1.0-ml] XDMP-UNEXPECTED: (err:XPST0003) Unexpected token syntax error, unexpected $end, expecting Function30_ or Percent_
Stack Trace
At line 21 column 0:
In xdmp:eval("xquery version "1.0-ml"; import module namespace t...", (), <options xmlns="xdmp:eval"><database>1754687030342455867</database>...</options>)
</metadata>
</options>
return
This is solved now, I was not returning the document insert function which was rightly pointed by @MadsHansen. Its solved now.