<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/xdmp.directory.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>xdmp.directory</api:function-name><api:suggest>xdmp.directory</api:suggest><api:suggest>xdmp</api:suggest><api:suggest>directory</api:suggest><api:function-link mode="xquery" fullname="xdmp:directory">/apidoc/8.0/xdmp:directory.xml</api:function-link><api:function mode="javascript" name="directory" type="builtin" lib="xdmp" category="Extension" subcategory="Documents, Directories, Properties, and Locks" hidden="false" bucket="MarkLogic Built-In Functions" prefix="xdmp" namespace="http://marklogic.com/xdmp" fullname="xdmp.directory"><api: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 <a href="./xdmp.filesystemDirectory" class="javascript" xmlns="http://www.w3.org/1999/xhtml">xdmp.filesystemDirectory</a> instead.
</api:summary><api:params><api:param name="uri" type="xs:string*"><api:param-description>
    The URI of the directory.  Typically, directory URIs end with a forward
    slash (/).
  </api:param-description><api:param-name>uri</api:param-name><api:param-type>String[]</api:param-type></api:param><api:param name="depth" type="xs:string?" optional="true"><api:param-description>
    "1" for immediate children, "infinity" for all.
    If not supplied, depth is "1".
  </api:param-description><api:param-name>depth</api:param-name><api:param-type>String?</api:param-type></api:param></api:params><api:return>ValueIterator</api:return><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
for (var d of xdmp.directory("http://example.com/foo/","1")) {
 xdmp.nodeUri(d);
};
  =&gt; http://example.com/foo/bar.xml
     http://example.com/foo/baz.xml
</pre></api:example></api:function></api:function-page>