Loading TOC...

MarkLogic 9 Product Documentation
dls:as-of-query

dls:as-of-query(
   $when as xs:dateTime
) as cts:properties-fragment-query

Summary

This function returns a query that matches the most recent numbered version of documents that were created before the specified date and time.

Parameters
when The date and time before which the documents were created.

Required Privileges

The dls-user role is required to run this function, or the privilege:
http://marklogic.com/xdmp/privileges/dls-user

Example

  xquery version "1.0-ml";

  import module namespace dls = "http://marklogic.com/xdmp/dls" 
      at "/MarkLogic/dls.xqy";

  cts:search(fn:doc(), dls:as-of-query(xs:dateTime(fn:current-dateTime())))
  
  (: Returns the versions of the managed documents that were created before the
     specified date and time. :)
    

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