MarkLogic: select all collections & select latest record from collection

Categories: Database July 1st, 2014 22:42

List all collections:

<collections>{
for $collection in cts:collections()
return <collection> { $collection } </collection>
}</collections>

Select latest record from collection:

let $uris := cts:uris(     (),     (),     cts:properties-query(         cts:and-query(( cts:collection-query('/collections/coll-A'), cts:collection-query('latest') )) ) )
return doc($uris)

<->



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.