Skip to content

Commit 24edf73

Browse files
Chris Choschmalliso
authored andcommitted
DOCSP-11180: UpdateOneBusinessKeyTimestampStrategy documentation (#35)
1 parent 9e3ffdc commit 24edf73

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

source/kafka-sink-postprocessors.txt

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ The record contains the following data after applying the projection:
427427

428428
{
429429
"forecast": [
430-
{
430+
{
431431
"day": "Monday",
432432
"uv": 5
433433
}
@@ -663,6 +663,10 @@ strategies are provided with the connector:
663663

664664
.. seealso:: Example of usage in :ref:`writemodel-strategy-timestamps`.
665665

666+
* - UpdateOneBusinessKeyTimestampStrategy
667+
- | Add ``_insertedTS`` (inserted timestamp) and ``_modifiedTS`` (modified timestamp) fields into documents that match the filters provided by the ``document.id.strategy`` setting.
668+
| Set the following configuration: ``writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneBusinessKeyTimestampStrategy``
669+
666670
.. note::
667671

668672
Future versions of the MongoDB Kafka Connector will allow developers to
@@ -676,12 +680,12 @@ WriteModel Strategy: Business Keys
676680
A business key is a value comprised of data within the sink record that
677681
identifies it as a unique document. This example defines a business key
678682
using data contained within multiple fields in the record as well as
679-
instructs the post processor to generate *BSON ObjectIds* for inserts,
683+
instructs the post processor to generate *BSON ObjectIds* for inserts,
680684
but not for updates.
681685

682686
The following steps are required to configure this strategy:
683687

684-
#. Create a :manual:`unique index </core/index-unique>` that corresponds to
688+
#. Create a :manual:`unique index </core/index-unique>` that corresponds to
685689
your business key in your target MongoDB collection.
686690
#. In the connector configuration, specify the ``PartialValueStrategy``
687691
as the id strategy to identify the fields that belong to the business
@@ -690,7 +694,7 @@ The following steps are required to configure this strategy:
690694
``ReplaceOneBusinessKeyStrategy`` writemodel strategy.
691695

692696
For this example, we track airplane capacity by the flight number and
693-
airport it is currently located represented by ``flight_no`` and
697+
airport it is currently located represented by ``flight_no`` and
694698
``airport_code``, respectively. An example message contains the following:
695699

696700
.. code-block:: json
@@ -755,18 +759,18 @@ values without changing the ``_id`` field.
755759
}
756760
}
757761

758-
.. admonition:: Projection post processors are not compatible with PartialValueStrategy
762+
.. admonition:: Projection post processors are not compatible with PartialValueStrategy
759763
:class: warning
760764

761-
The ``PartialValueStrategy`` id strategy uses the
765+
The ``PartialValueStrategy`` id strategy uses the
762766
``[key|value].projection.type`` and ``[key|value].projection.list``
763-
settings to define which fields are used to form the ``_id`` field.
767+
settings to define which fields are used to form the ``_id`` field.
764768
Since the Blocklist and Allowlist post processors use the same
765769
projection settings, they cannot be specified separately. Use a `Single
766770
Message Transform (SMT)
767771
<https://docs.confluent.io/current/connect/transforms/index.html>`_
768-
outside the connector to format your source data as necessary.
769-
772+
outside the connector to format your source data as necessary.
773+
770774
.. _writemodel-strategy-timestamps:
771775

772776
WriteModel Strategy: Inserted and Modified Timestamps

0 commit comments

Comments
 (0)