dls.documentVersion( uri as String, version-number as Number ) as Node
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. |
dls-user
role is required to run
this function, or the privilege:http://marklogic.com/xdmp/privileges/dls-user
// 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);