MarkLogic Server 11.0 Product Documentation
temporal:statement-get-system-time

temporal:statement-get-system-time() as empty-sequence()

Summary

This function gets the system start time on temporal documents that are inserted or deleted in the same statement as this function. If this function is not called along with a temporal document insert or delete, nothing will be affected.

Example

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="validStart">
           <map:value>1601-01-01T13:59:00Z</map:value>
         </map:entry>
         <map:entry key="validEnd">
           <map:value>9999-12-31T11:59:59Z</map:value>
         </map:entry> 
       </map:map>
    </metadata> 
</options> 
return 
temporal:document-insert("kool", "koolorder.xml", $root, $options),
temporal:statement-get-system-time()

Powered by MarkLogic Server | Terms of Use | Privacy Policy