Using Transform Module during MLCP Ingestion to MarkLogic

北战南征 提交于 2019-12-01 13:54:30

MLCP expects the transform function to return an the updated content argument. Try the following:

function envelope(content, context)
{
  var transformed ={};
  transformed.Metadata = { "Created" : "Time"};
  transformed.Source = content.value;
  content.uri = fn.concat("/transformed/",content.uri);
  content.value = transformed;
  return content;
};
exports.transform = envelope;

Provide target collection names with the -output_collections parameter. You can also prefix uri with /transformed/ using the -output_uri_prefix, or the -output_uri_replace parameter.

You can find documentation about command-line options here:

http://docs.marklogic.com/guide/mlcp/import#id_23879

Documentation about MLCP transforms can be found here:

http://docs.marklogic.com/guide/mlcp/import#id_82518

HTH!

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!