Skip to content

Instantly share code, notes, and snippets.

@ableasdale
Created September 17, 2018 19:04
Show Gist options
  • Save ableasdale/a280e684c5b7f12e8fa5eb469ec58e3d to your computer and use it in GitHub Desktop.
Save ableasdale/a280e684c5b7f12e8fa5eb469ec58e3d to your computer and use it in GitHub Desktop.
MarkLogic: pull details from xdmp:plan for a preflight check
xquery version "1.0-ml";
declare namespace q = "http://marklogic.com/cts/query";
declare variable $QUERY as cts:query := cts:and-query(());
fn:data(xdmp:plan(cts:search(doc(), $QUERY))/q:result/@estimate)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment