Loading TOC...

MarkLogic 12 EA 1 Product Documentation
temporal:set-use-lsqt

temporal:set-use-lsqt(
   $temporal-collection as xs:string,
   $on as xs:boolean
) as empty-sequence()

Summary

This function enables or disables the use of LSQT (Last Stable Query Time) on the named collection. When enabled (true), a document is created in the database to hold the LSQT. This document is identified by the collection name with an .lsqt suffix.

You must have LSQT enabled on the temporal collection in order to 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.
on Set to fn:true() to enable LSQT on the collection or fn:false() (the default) to disable LSQT.

Example


xquery version "1.0-ml"; 
 
import module namespace temporal = "http://marklogic.com/xdmp/temporal" 
      at "/MarkLogic/temporal.xqy";
 
temporal:set-use-lsqt("kool", fn:true())

   (: 
   Set the temporal collection, "kool", to use LSQT. A document, named
   "kool.lsqt", that contains the latest LSQT is created in the database. 
   Requires the specified temporal collection to exist. Use 
   temporal.collectionCreate to create the temporal collection.
   :)

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