Loading TOC...

xdmp:directory

xdmp:directory(
   $uri as xs:string*,
   [$depth as xs:string?]
) as document-node()*

Summary

Returns the documents from the database in a directory. Note that these are database documents, not from the filesystem; if you want documents from a filesystem directory, use xdmp:filesystem-directory instead.

Parameters
$uri The URI of the directory. Typically, directory URIs end with a forward slash (/).
$depth "1" for immediate children, "infinity" for all. If not supplied, depth is "1".

Example

for $d in xdmp:directory("http://example.com/foo/","1")
return xdmp:node-uri($d)
  => http://example.com/foo/bar.xml
     http://example.com/foo/baz.xml

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.