I am trying to implement envelope pattern when i am ingesting documents through MLCP
My transform Module is like this :
function envelope(content, context)
{
var transformed ={};
transformed.Metadata = { "Created" : "Time"};
transformed.Source = content.value;
content.uri = fn.concat("/transformed/",content.uri);
content.value = transformed;
};
exports.transform = envelope;
My MLCP Command is like this
mlcp.bat import -host localhost -port 8000 -username admin -
password admin -mode local -input_file_path D:\Marklogic\abcd.csv -input_file_ty
pe delimited_text -document_type json -transform_module /example/
mlcp-transform.sjs -transform_function transform -output_collections transformed -ge
nerate_uri true
MLCP Error :
18/01/31 09:00:27 WARN contentpump.TransformWriter: Failed document /D:/Marklogi
c/test.pcr-0-9
18/01/31 09:00:27 WARN contentpump.TransformWriter: TypeError: Cannot read prope
rty 'uri' of undefined
18/01/31 09:00:27 WARN contentpump.TransformWriter: TypeError: Cannot read prope
rty 'uri' of undefined
I don't know why it cant able to read the uri
in my transform module.
Any help is appreciated
Thanks