Loading TOC...

temporal:advance-lsqt

temporal:advance-lsqt(
   $temporal-collection as xs:string,
   [$lag as xs:unsignedInt]
) as xs:dateTime

Summary

This function enables Last Stable Query Time (LSQT) on the named collection and advances the LSQT for the collection to the maximum system start time. When LSQT is enabled on the temporal collection, you can use the temporal:statement-set-system-time function to manually set the system start time when inserting a document into that collection.

For details on how to use LSQT, see Last Stable Query Time (LSQT) and Application-controlled System Time in the Temporal Developer's Guide

Parameters
$temporal-collection The name of the temporal collection for which to advance the LSQT.
$lag The lag (in milliseconds) to subtract from the maximum system start time in the temporal collection.

Example


xquery version "1.0-ml"; 
 
import module namespace temporal = "http://marklogic.com/xdmp/temporal" 
      at "/MarkLogic/temporal.xqy";
 
temporal:advance-lsqt("temporalCollection", 1000)
=>
the time lsqt is at now
(: Advances the Last Stable Query Time for the "temporalCollection" collection
   to the maximum system start time - 1000ms. :)

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