Loading TOC...

dls.linkReferences

dls.linkReferences(
   node as Node,
   restriction as cts.query?
) as Sequence

Summary

This function returns a list of all the distinct URIs of documents referenced (either directly or indirectly) in the expansion of the node. The URIs are mapped according to the specified restrictions.

Parameters
node The node to be expanded.
restriction Restriction that control which documents may be considered for inclusion. An exact URI match is first considered if it matches the specified restrictions, followed by the most recent numbered version of that URI that matches the restrictions.

Required Privileges

The dls-user role is required to run this function, or the privilege:
http://marklogic.com/xdmp/privileges/dls-user

Example

  // Returns the URIs of the referenced nodes in Version 4 of the 'baz.xml' 
  // document and all of the referenced nodes referenced from its referenced 
  // nodes. 

const dls = require('/MarkLogic/dls');

let node = cts.doc('/foo/bar/baz.xml');

dls.linkReferences(node, dls.documentVersionQuery(4));
   

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