1

According to the documentation:

Document metadata added by steps

For every content object outputted by a Data Hub step, regardless of the step type, Data Hub will add the following document metadata keys and values to the document wrapped by the content object:

  • datahubCreatedOn = the date and time at which the document is written
  • datahubCreatedBy = the MarkLogic user used to run the step
  • datahubCreatedInFlow = the name of the flow containing the step being run
  • datahubCreatedByStep = the name of the step being run
  • datahubCreatedByJob = the ID of the job being run; this will contain the job ID of every flow run on the step, with multiple values being space-delimited

Is there any possibility to add some extra metadata keys and values to the document?

Mads Hansen
  • 63,927
  • 12
  • 112
  • 147
Den_Alex
  • 51
  • 2

1 Answers1

2

It is possible to add additional static values in your headers options or use one of these keywords to dynamically add values.

{
    "headers": {
        "sources": [{
            "name": "loadCustomersJSON"
        }],
        "createdOn": "datahubCreatedOn",
        "createdBy": "datahubCreatedBy"
    }
}

You can also dynamically add values by using an interceptor (See: https://docs.marklogic.com/datahub/5.6/flows/about-interceptors-custom-hooks.html) or updating the header value in a custom step if you are already using one (See:https://docs.marklogic.com/datahub/5.6/modules/editing-custom-step-module.html

  • Since they mentioned the metadata keys datahubCreatedOn, etc. I think they want to change the document metadata, which can be done by setting content.context.metadata as described in the "Required Inputs" section of "Editing a Custom Step Module". (https://docs.marklogic.com/datahub/5.6/modules/editing-custom-step-module.html) – justdewit Jan 04 '22 at 17:28
  • Ok, Andrew, thanks for your answer! – Den_Alex Jan 05 '22 at 07:28