Loading TOC...

xdmp:directory-delete

xdmp:directory-delete(
   $uri as xs:string
) as empty-sequence()

Summary

Deletes a directory and all of its child and descendant documents and directories from the database.

Parameters
$uri The URI of the directory to be deleted.

Usage Notes

If you delete a directory, the directory and all of its children and descendants (recursively) are deleted, including all child documents and directories. A child document or directory of a given directory is one whose URI begins with the same string as the directory URI.

Example

xdmp:directory-delete("http://example.com/")

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

Comments

The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.
  • xdmp:directory-delete() is timing out when ever the directory is having high count of documents like greater than 2 Million..is there any way/method that handles deletion of documents (greater than 50 Million) with less span of time... Note: directory creation setting is set to Manual
    • Siva, only a few people get updates about comments here; more people will see your question if you post it on Stack Overflow with the "marklogic" tag. (See the "Ask a Question" link in the upper right corner of this page.) A similar question was asked a couple years ago there, perhaps it will help: https://stackoverflow.com/questions/27670544/what-is-the-best-way-to-delete-more-than-100-000-files