Loading TOC...

MarkLogic 9 Product Documentation
xdmp.directory

xdmp.directory(
   uri as String[],
   [depth as String?]
) as Sequence

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.filesystemDirectory 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 (var d of xdmp.directory("http://example.com/foo/","1")) {
 xdmp.nodeUri(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.