ConnectorLib C++ 23.3

# Ingest Replace

The `Replace` method is short-hand for performing a `Remove` followed by an ``Add``. You can use this method when a document in a repository has been changed.

           DocInfo docInfo = task.docInfoBuilder().createDocInfo(
              "http://www.example.com/testDocument.doc",
              "testDocument.doc",
              true);

           Metadata metadata = docInfo.doc().metadata();
           metadata.addField("MyField", "New Value");
           metadata.addField("SecondField", "Only one value now");

           task.ingester().replace(docInfo);

This example is very similar to the example for Ingest Add. It might be used in the `synchronize` action when `testDocument.doc` has been modified. In the ingestion target, both the content of the file and the metadata fields are replaced.

Copyright 2022 Open Text
Version 23.3 | Last updated June 2023

Send documentation feedback

Close

Send documentation feedback

To send feedback using your default email client, open an email window.

Otherwise, send your feedback and the information below to swpdl.idoldocsfeedback@microfocus.com.

We appreciate your feedback!

Product: IDOL ConnectorLib C++ 23.3

Topic Title: Ingest Replace