You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- | Full Path: ``com.mongodb.kafka.connect.sink.processor.id.strategy.UuidStrategy``
174
174
| Generates a random UUID as a string.
175
175
176
+
176
177
You can assign the ``document.id.strategy`` property as follows:
177
178
178
179
.. code-block:: properties
@@ -449,6 +450,10 @@ specified.
449
450
[key|value].projection.type=BlockList
450
451
[key|value].projection.list=**.high
451
452
453
+
The record contains the following data after applying the projection:
454
+
455
+
.. code-block:: json
456
+
452
457
{
453
458
"city": "Springfield",
454
459
"population: {
@@ -504,7 +509,7 @@ RenameByMapping Example
504
509
^^^^^^^^^^^^^^^^^^^^^^^
505
510
506
511
The ``RenameByMapping`` post processor setting specifies one or more
507
-
objects that assigns fields matching a string to a new name in a Key or Value
512
+
objects that assign fields matching a string to a new name in a Key or Value
508
513
document.
509
514
510
515
Each object contains the text to match in the ``oldName`` element and the
@@ -683,19 +688,29 @@ provided with the connector:
683
688
684
689
.. seealso::
685
690
686
-
Example of usage in :ref:`writemodel-strategy-business-key`.
691
+
Example of usage in :ref:`ReplaceOneBusinessKey example <replaceonebusinesskey-example>`.
692
+
687
693
* - DeleteOneDefaultStrategy
688
694
- | Deletes at most one document that matches the id specified by the ``document.id.strategy`` setting, only when the document contains a null value record.
689
695
| Implicitly specified when the configuration setting ``mongodb.delete.on.null.values=true`` is set.
690
696
| You can set this explicitly with the following configuration: ``writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.DeleteOneDefaultStrategy``
691
697
698
+
* - DeleteOneBusinessKeyStrategy
699
+
- | Deletes at most one document that matches filters provided in the ``document.id.strategy`` setting.
700
+
| Set the following configuration: ``writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.DeleteOneBusinessKeyStrategy``
701
+
702
+
.. seealso::
703
+
704
+
Example of usage in :ref:`DeleteOneBusinessKey example <deleteonebusinesskey-example>`.
705
+
692
706
* - UpdateOneTimestampsStrategy
693
707
- | Add ``_insertedTS`` (inserted timestamp) and ``_modifiedTS`` (modified timestamp) fields into documents.
694
708
| Set the following configuration: ``writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneTimestampsStrategy``
695
709
696
710
.. seealso::
697
711
698
-
Example of usage in :ref:`writemodel-strategy-timestamps`.
712
+
Example of usage in :ref:`WriteModel Strategy: Inserted and Modified Timestamps<writemodel-strategy-timestamps>`.
713
+
699
714
* - UpdateOneBusinessKeyTimestampStrategy
700
715
- | Add ``_insertedTS`` (inserted timestamp) and ``_modifiedTS`` (modified timestamp) fields into documents that match the filters provided by the ``document.id.strategy`` setting.
701
716
| Set the following configuration: ``writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneBusinessKeyTimestampStrategy``
@@ -768,11 +783,19 @@ in the MongoDB collection that matches the ID from the value document.
768
783
WriteModel Strategy: Business Keys
769
784
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
770
785
771
-
A business key is a value comprised of data within the sink record that
772
-
identifies it as a unique document. This example defines a business key
773
-
using data contained within multiple fields in the record as well as
774
-
instructs the post processor to generate *BSON ObjectIds* for inserts,
775
-
but not for updates.
786
+
A **business key** is a value comprised of data within the sink record that
787
+
identifies it as a unique document. The following examples demonstrate
788
+
WriteModel strategies that define business keys using one or more fields
789
+
from the sink record.
790
+
791
+
.. _replaceonebusinesskey-example:
792
+
793
+
ReplaceOneBusinessKeyStrategy Example
794
+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
795
+
796
+
In this example, we assemble a business key from multiple fields of a
797
+
record and instruct the post processor to generate BSON **ObjectId**
798
+
instances for inserts, but not for updates.
776
799
777
800
Follow the steps below to configure this strategy:
778
801
@@ -784,7 +807,7 @@ Follow the steps below to configure this strategy:
0 commit comments