Loading TOC...

MarkLogic 12 EA 1 Product Documentation
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 =
    {"tempdoc": 
       {"content": "content here"}
    };
var options =
    {metadata:
       {validStart: "1601-01-01T13:59:00Z",
        validEnd: "9999-12-31T11:59:59Z"}
    };
temporal.documentInsert("kool", "doc.json", root, options);
temporal.statementSetSystemTime(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.