Wiki source for MarkLogicListdir

Show raw source

======Mark Logic Command: listdir======
Lists directories in a Mark Logic directory

listdir [options] [directory ...]

Lists directories residing on a Mark Logic server and outputs to stdout.
With no directory arguement it lists all directories. This might exceed the server's memory.
With directory arguments then the list is constrained to documents in that directory one level deep only.

||c,-connect uri||Use the connection string instead of $MLCONNECT||

Assuming the prefix "ml" is imported as the marklogic module, prints to stdout (one uri per line) all the directories in the /Test/ directory.

ml:listdir /Test/


listdir is implemented as a simple xsh script which simply calls query. The source of the script is

if [ $# -eq 0 ] ; then
:query -q <{{
declare namespace prop="";
for $d in
order by $d
return $d

:query -q "xdmp:directory-properties('$1')/base-uri()"


To list documents in a directory see [[MarkLogicList list]]

[[ModuleMarkLogic MarkLogic Extension Module]]
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki