Loading TOC...

temporal.statementSetSystemTime

temporal.statementSetSystemTime(
   $system-time as Date
) as null

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

declareUpdate();
var temporal = require("/MarkLogic/temporal.xqy");

var root = fn.head(xdmp.unquote(
  '<tempdoc>\n\
    <systemStart>2001-01-01T00:00:00Z</systemStart>\n\
    <systemEnd>2001-01-01T00:00:00Z</systemEnd>\n\
    <validStart>2014-06-03T14:13:05.472585-07:00</validStart>\n\
    <validEnd>9999-12-31T11:59:59Z</validEnd>\n\
    <content>v1-content here</content>\n\
  </tempdoc>')).root;
temporal.documentInsert( "temporalCollection", "doc.xml", root, 
       null, null, null, null );
temporal.statementSetSystemTime(
    xs.dateTime("1990-01-01T00:00:00.00-00:00"));

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy