Loading TOC...


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


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

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:


  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. :)

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