xdmp.describe( item as Sequence, [max-sequence-length as Number?], [max-item-length as Number?] ) as String
Returns a string representing the description of a given item sequence. If you take the output of this function and evaluate it as an XQuery program, it returns the item(s) input to the function.
If you specify an item that is in a database, this function
returns the path to the item (or to the items if you specify multiple items).
If the item or items are constructed in XQuery, then it prints out the item,
truncating the characters in each item according to the
max-item-length
parameter.
xdmp.describe(fn.currentDate()); => xs.dateTime("2014-11-06T08:00:00")
var x = xdmp.toJSON({key:"value"}); xdmp.describe(x); => document{{"key":"value"}}
// assume /mydoc.json is a JSON document with the following content: // {key: "value"} xdmp.describe(cts.doc("/mydoc.json").root.key) => fn.head(xdmp.unpath("fn:doc('/mydoc.json')/text('key')"))
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.