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 JavaScript object containing the same properties as the content input parameter (uri and value). When returning multiple document objects, put them in a Sequence.

The document content 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 modify the context input parameter to specify collections, permissions, quality, and values metadata for the documents returned by your transform. Use the following property names and data formats for specifying various categories of metadata:

Context Property 

Expected Value Format 

collections

An array of strings, each representing a collection URIs.

permissions

An array of permission objects, each containing a capability and a roleId property. For details, see xdmp:permission.

 

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

metadata

An object where each property represents a key-value metadata item.

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.