MarkLogic 9 Product Documentation
dls:document-unmanage

dls:document-unmanage(
   $uri as xs:string,
   $deep as xs:boolean,
   $remove-versions as xs:boolean
) as empty-sequence()

Summary

Removes the specified document from management. You must have update permissions on the document to unmanage the document.

Parameters
uri The URI of the document.
deep Specifies whether to unmanage this document as well as any documents for which this document has XInculde references to. Specify true to unmanage all XInclude references or false to leave any included documents as managed documents. The default is false.
remove-versions Specify true to delete all but the latest version during the unmanage operation, false to leave any older versions in the database as unmanaged documents.

Required Privileges

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

Example

 
  xquery version "1.0-ml";

  import module namespace dls = "http://marklogic.com/xdmp/dls" 
      at "/MarkLogic/dls.xqy";

  dls:document-unmanage("/foo/bar/baz.xml", fn:false(), fn:true()) 

  (: Unmanages 'baz.xml', but maintains management of its referenced
     documents. All versions but the latest version of this document 
     are deleted. :)
    
Powered by MarkLogic Server | Terms of Use | Privacy Policy