
xdmp.documentDelete( uri as String, [options as Object?] ) as null
Deletes a document from the database.
The xdmp:document-delete function deletes
a document and all of its properties, except, when
directory-creation is set to automatic or
manual-enforced, the directory property; it does
not delete a directory with the same URI as the document being deleted unless
directory-creation is set to manual.
To delete a directory, use the xdmp:directory-delete function.
declareUpdate();
xdmp.documentDelete('example.xml');
// Enable deletion of a non-existent document without raising an error.
declareUpdate();
xdmp.documentDelete('example.xml',{ifNotExists:"allow"});
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.