Loading TOC...

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

temporal:statement-set-system-time(
   $system-time as xs:dateTime
) as empty-sequence()

Summary

This function sets 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.

Parameters
system-time The dateTime to set.

Required Privileges

http://marklogic.com/xdmp/privileges/temporal-statement-set-system-time

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-set-system-time( xs:dateTime("1601-01-01T14:00:00Z"))

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.