Skip to content

Instantly share code, notes, and snippets.

@tternquist
Last active December 22, 2016 23:09
Show Gist options
  • Save tternquist/ff6aad2a45360605a860a8a170a4e7cd to your computer and use it in GitHub Desktop.
Save tternquist/ff6aad2a45360605a860a8a170a4e7cd to your computer and use it in GitHub Desktop.
Query on root element in MarkLogic
declare namespace qry = "http://marklogic.com/cts/query";
let $root-element := "*:myRootElem"
return
cts:term-query(xdmp:plan(/xdmp:unpath($root-element))//qry:final-plan//qry:term-query/qry:key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment