Loading TOC...

xdmp.describe

xdmp.describe(
   $item as ValueIterator,
   [$max-sequence-length as Number?],
   [$max-item-length as Number?]
) as String

Summary

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.

Parameters
$item The item sequence whose description is returned.
$max-sequence-length Represents the maximum number of items per sequence to print. The default is 3. () means no maximum.
$max-item-length Represents the maximum number of characters per item to print. The default is 64. The minimum is 8. () means no limit.

Usage Notes

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.

Example

xdmp.describe(fn.currentDate());

=> xs.dateTime("2014-11-06T08:00:00")

Example

var x = xdmp.toJSON({key:"value"});
xdmp.describe(x);

  => document{{"key":"value"}}

Example

//  assume /mydoc.json is a JSON document with the following content:
//    {key: "value"}
xdmp.describe(cts.doc("/mydoc.json").root.key)

  => fn.doc("/mydoc.json")/text("key")

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy