
dls.linkReferences( node as Node, restriction as cts.query? ) as Sequence
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.
dls-user role is required to run
this function, or the privilege:http://marklogic.com/xdmp/privileges/dls-user
// 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));