<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.documentDelete.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.documentDelete</api:function-name><api:suggest>xdmp.documentdelete</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>documentdelete</api:suggest><api:function-link mode="xquery" fullname="xdmp:document-delete">/apidoc/8.0/xdmp:document-delete.xml</api:function-link><api:function mode="javascript" name="documentDelete" type="builtin" lib="xdmp" category="UpdateBuiltins" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.documentDelete"><api:summary>
  Deletes a document from the database.
  </api:summary><api:params><api:param name="uri" type="xs:string"><api:param-description>
    The URI of the document to be deleted.
    </api:param-description><api:param-name>uri</api:param-name><api:param-type>String</api:param-type></api:param></api:params><api:return>null</api:return><api:usage><p xmlns="http://www.w3.org/1999/xhtml">The <code>xdmp:document-delete</code> function deletes
  a document and all of its properties, except, when 
  <code>directory-creation</code> is set to <code>automatic</code> or
  <code>manual-enforced</code>, the directory property; it does
  not delete a directory with the same URI as the document being deleted unless
  <code>directory-creation</code> is set to <code>manual</code>.
  To delete a directory, use the <code>xdmp:directory-delete</code> function.
  </p><p xmlns="http://www.w3.org/1999/xhtml">If a document does not exist at the specified URI,
  <code>xdmp:document-delete</code> throws an error.</p>
  </api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
declareUpdate();
xdmp.documentDelete("example.xml");
</pre></api:example></api:function></api:function-page>