dls:document-purge( $uri as xs:string, $delete as xs:boolean, $retain-history as xs:boolean ) as xs:string*
This function deletes all numbered versions of the specified
managed document and its referenced documents, as specified by the retention
policies set by
dls:retention-rule
. The document versions are
deleted if they
have no retention rule causing them to be kept and if they are not included
by documents that cannot yet be deleted. If $delete
is
false
, the document's versions are not actually deleted and instead
a list of the documents that would have been deleted is returned.
$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-purge("/foo/bar/baz.xml", fn:false(), fn:true()) (: Returns the versions of the 'baz.xml' document and its referenced documents, as specified by the retention policy. :)