MarkLogic Server 11.0 Product Documentation
dls.documentVersion

dls.documentVersion(
   uri as String,
   version-number as Number
) as Node

Summary

This function returns a particular version of a managed document. An error is thrown if there is no such version.

Parameters
uri The URI of the document.
version-number The version of the document to be returned.

Required Privileges

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

Example

// Restores version 1 of the 'baz.xml' document.

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

  dls.documentUpdate(
           '/foo/bar/baz.xml',
            dls.documentVersion('/foo/bar/baz.xml', 1),
            'restoring from version 1', 
            true);
   
Powered by MarkLogic Server | Terms of Use | Privacy Policy