dls.documentCheckout( uri as String, deep as Boolean, [annotation as Item?], [timeout as (Number|String)?] ) as null
This function checks out (locks) the document at the specified URI to prevent other users from modifying the document. An exception is thrown if the document does not yet exist or does exist but is not managed.
This function must be called in a separate transaction from thedls.documentUpdate
and
dls.documentCheckin
functions.
dls-user
role is required to run
this function, or the privilege:http://marklogic.com/xdmp/privileges/dls-user
// Checks out the 'baz.xml' document, and all of its included documents, // for one hour. const dls = require('/MarkLogic/dls'); declareUpdate(); dls.documentCheckout('/foo/bar/baz.xml', true, 'updating doc', 3600);
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.