MARKLOGIC: Is it possible to use more than 1 columns from a CSV file when generating URI ID during data ingestion in MarkLogic?

前端 未结 1 1054
-上瘾入骨i
-上瘾入骨i 2021-01-25 08:29

I am quite new to MarkLogic and I am not sure how to best deal with the challenge I have right now.

I have a CSV file exported from a table that will be ingested to Mark

1条回答
  •  囚心锁ツ
    2021-01-25 08:49

    You can use MLCP Transforms to transform both the content value, and the uri. It gets a hash object $content containing both. Update its values as desired, and return the updated hash object. Something like:

    declare function example:transform(
      $content as map:map,
      $context as map:map
    ) as map:map*
    {
      let $record := map:get($content, "value")
      let $uri := $record/prop1 || $record/prop2 || $record/prop3 
      let $_ := map:put($content, "uri", $uri)
      return $content
    };
    

    You can use such MLCP transforms in marklogic-data-hub as well.

    HTH!

    0 讨论(0)
提交回复
热议问题