Loading TOC...

dls.documentHistory

dls.documentHistory(
   $uri as String
) as element(dls.documentHistory)

Summary

Returns the version history of the document located at the specified URI.

Parameters
$uri The URI 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

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

dls.documentHistory('/foo/bar/baz.xml');

/*
<dls:document-history uri="/foo/bar/baz.xml" xmlns:dls="http://marklogic.com/xdmp/dls">
  <dls:version>
    <dls:version-id>1</dls:version-id>
    <dls:document-uri>/sample.xml</dls:document-uri>
    <dls:latest>true</dls:latest>
    <dls:created>2018-04-27T16:38:18.880566-07:00</dls:created>
    <dls:author>1975742840184594244</dls:author>
    <dls:external-security-id>0</dls:external-security-id>
    <dls:external-user-name>
    </dls:external-user-name>
    <dls:annotation>Baz is now a managed document</dls:annotation>
    <dls:deleted>false</dls:deleted>
  </dls:version>
</dls:document-history>
*/
   

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