cts:query
dls-user
http://marklogic.com/xdmp/privileges/dls-user
xquery version "1.0-ml"; import module namespace dls = "http://marklogic.com/xdmp/dls" at "/MarkLogic/dls.xqy"; cts:search(fn:doc(), dls:as-of-query(xs:dateTime(fn:current-dateTime()))) (: Returns the versions of the managed documents that were created before the specified date and time. :)
xquery version "1.0-ml"; import module namespace dls = "http://marklogic.com/xdmp/dls" at "/MarkLogic/dls.xqy"; cts:search(fn:doc(), dls:author-query(xdmp:user("Jim"))) (: Returns all of the documents authored by 'Jim'. :)
xquery version "1.0-ml"; import module namespace dls = "http://marklogic.com/xdmp/dls" at "/MarkLogic/dls.xqy"; cts:search(fn:doc(), dls:document-include-query("/foo.xml")) (: Returns the contents of the documents that contain an XInclude to the '/foo.xml' document. :)
xquery version "1.0-ml"; import module namespace dls = "http://marklogic.com/xdmp/dls" at "/MarkLogic/dls.xqy"; cts:search(fn:doc(), dls:document-version-query(3)) (: Returns Version 3 of all of the managed documents in the database. :)
xquery version "1.0-ml"; import module namespace dls = "http://marklogic.com/xdmp/dls" at "/MarkLogic/dls.xqy"; cts:search(fn:doc(), dls:document-versions-query("/foo/bar/baz.xml")) (: Returns the contents of all versions of the 'baz.xml' document. :)
xquery version "1.0-ml"; import module namespace dls = "http://marklogic.com/xdmp/dls" at "/MarkLogic/dls.xqy"; cts:search(fn:doc(), dls:documents-query()) (: Returns the latest versions of the managed documents in the database. :)