Chao Jiang
Chao Jiang

Reputation: 503

Marklogic show whole query in console

I'm debug my XQuery code, In MarkLogic console, I want to view the query statement.And I use such as below scripts:

cts:parse("cat OR dog AND mouse")

But it gives me below response:

cts:or-query((cts:element-value-query(fn:QName("", "ElementA"), "XXXX",("lang=en"), 0),cts:element-value-query(fn:QName("", "ElementB"), "XXXX",("lang=en"), 0), ...), ())

It use the apostrophe ellipsis(...) to display the result as it too long.

Is there any possible to show the whole query statement?

Upvotes: 1

Views: 130

Answers (2)

grtjn
grtjn

Reputation: 20414

You can wrap it in document {} which will make it return the XML representation:

document{cts:parse("cat OR dog AND mouse")}

HTH!

Upvotes: 2

Tamas
Tamas

Reputation: 11244

Actually now I see what you mean. If your query is larger you can use xdmp:describe()

xdmp:describe(
  cts:parse("cat OR dog AND mouse OR fly OR cow"),
5);

(modify the second parameter according to your needs)

Old response

Not sure why you see the '...' - for

cts:parse("cat OR dog AND mouse")

I get the full response:

cts:or-query((cts:word-query("cat", ("lang=en"), 1), cts:and-query((cts:word-query("dog", ("lang=en"), 1), cts:word-query("mouse", ("lang=en"), 1)), ("unordered"))), ())

Upvotes: 3

Related Questions