MarkLogic Server 11.0 Product Documentation
fn.generateId

fn.generateId(
   [node as Node?]
) as String

Summary

Returns a string that uniquely identifies a given node.

If $node is the empty sequence, the zero-length string is returned.

If the function is called without an argument, the context item is used as the default argument. The behavior of the function when the argument is omitted is the same as if the context item is passed as an argument.

If the context item is undefined an error is raised: [err:XPDY0002]. If the context item is not a node an error is raised: [err:XPTY0004].

Parameters
node The node whose ID will be generated.

Example

var doc = cts.doc("/bar.json");
fn.generateId(doc);
=> naaaaffcc704258cd
Powered by MarkLogic Server | Terms of Use | Privacy Policy