Loading TOC...

MarkLogic 12 Product Documentation
xdmp:node-get-info

xdmp:node-get-info(
   $node as node(),
   [$output-kind as xs:string*]
) as 

Summary

This function returns information about the node i.e. the node-repid, uniquekey, compressed tree size and database of an input node. Database is true if the node is read from the database, false otherwise.

Parameters
node The node whose noderepid/uniqueKey is returned.
output-kind The output kind can be either:

"xml"

Return the result as a sequence of xml elements.

"json"

Return the result as a sequence of json elements

"map"

Return the result as a sequence of map values

default

The default is "json".

Example

xdmp:node-database(doc("http://marklogic.com/document"),"xml")
==>
<xdmp:node-info xmlns:xdmp="http://marklogic.com/xdmp">
  <compressed-tree-size>78</compressed-tree-size>
  <node-rep-id>0</node-rep-id>
  <node-unique-key>152469828419602699</node-unique-key>
  <database-node>1</database-node>
</xdmp:node-info>

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.