Loading TOC...

dls.documentVersionAsOf

dls.documentVersionAsOf(
   uri as String,
   as-of as Date
) as Node

Summary

This function returns the most recent version of a document as of a point in time.

Parameters
uri The URI of the document.
as-of The date and time from which you want to retrieve the most recent version of the document.

Required Privileges

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

Example

// Returns the most recent version of the 'baz.xml' document since the 
// specified date and time.

const dls = require('/MarkLogic/dls');

 dls.documentVersionAsOf(
                   '/foo/bar/baz.xml',
                    xs.dateTime('2009-04-07T09:43:16.531-07:00')); 
   

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