Skip to content

Instantly share code, notes, and snippets.

@ableasdale
Created November 29, 2012 19:46
Show Gist options
  • Save ableasdale/4171388 to your computer and use it in GitHub Desktop.
Save ableasdale/4171388 to your computer and use it in GitHub Desktop.
A List of all documents ordered by the time they were inserted into the database
xquery version "1.0-ml";
for $doc in doc()
let $sort-key := xs:dateTime(xdmp:document-properties(fn:base-uri($doc))/prop:properties/prop:last-modified)
order by $sort-key
return
fn:concat("Doc: ", fn:base-uri($doc), " was inserted at: ", $sort-key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment