Revision [972]

This is an old revision of MarkLogicListdir made by DavidLee on 2009-11-25 05:03:52.

 

Mark Logic Command: listdir

Lists directories in a Mark Logic directory

Synopsis

list [-c uri|-connect uri] [directory ...]

Description

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.



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



Example

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/


Implementation


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="http://marklogic.com/xdmp/property";
for $d in 
xdmp:document-properties()//prop:directory/base-uri()
order by $d
return $d
	
}}>
else
	:query -q "xdmp:directory-properties('$1')/base-uri()"
fi


To list directories in a directory see listdir





MarkLogic Extension Module
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki