Skip to main content

Using MarkLogic Content Pump (mlcp)

Expected Output

Your function can produce more than one output document. For each document, your function should return a map:map. The map:map for an output document must use the same keys as the $content map (uri and value).

Note

Modifying the document URI in a transformation can cause duplicate URIs when combined with the -fastload option, so you should not use -fastload or -output_directory with a transformation module that changes URIs. For details, see Time vs. Correctness: Understanding -fastload Tradeoffs.

The documents returned by your transformation should be exactly as you want to insert them into the database. No further transformations are applied by the mlcp infrastructure. For example, a transform function cannot affect document type just by changing the URI. Instead, it must convert the document node. For details, see Example: Changing the URI and Document Type.

You can use the context parameter to specify collections, permissions, quality, and values metadata for the documents returned by your transform. Use the following keys and data formats for specifying various categories of metadata:

Context Map Key

Expected Value Format

collections

A sequence of strings containing collection URIs.

permissions

A sequence of sec:permission elements, each representing a capability and a role id. For details, see xdmp:permission.

quality

An integer value (or a string that can be converted to an integer).

metadata

A map:map containing key-value metadata.

temporalCollection

A string containing a temporal document collection URI.

For a description of the meaning of the keys, see Input Parameters.

If your function returns multiple documents, they will all share the metadata settings from the context parameter.