dls:document-delete( $uri as xs:string, $keep-old-versions as xs:boolean, $retain-history as xs:boolean ) as empty-sequence()
This function removes the specified managed document. You must have update permissions on the document to delete it.
If you set$retain-history
to true
, you can use
xdmp:document-properties
to view the deleted document's properties
fragment in the database.
dls-user
role is required to run
this function, or the privilege:http://marklogic.com/xdmp/privileges/dls-user
xquery version "1.0-ml"; import module namespace dls = "http://marklogic.com/xdmp/dls" at "/MarkLogic/dls.xqy"; dls:document-delete("/foo/bar/baz.xml", fn:false(), fn:true()) (: Deletes all versions of the 'baz.xml' document and retains the property fragment for each version. :)