File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -696,11 +696,10 @@ Create Your Own Custom Write Strategy
696
696
697
697
If none of the pre-built write strategy models suits your needs, you can
698
698
create your own. A custom write strategy model is a Java class that implements
699
- ``WriteModelStrategy``. Specify your Java class in the
700
- ``mongodb.writemodel.strategy`` :ref:`configuration setting
701
- <kafka-sink-properties>`.
699
+ ``WriteModelStrategy``.
702
700
703
- To create a custom ``WriteModelStrategy``:
701
+ To configure your Sink Connector to use the custom ``WriteModelStrategy``,
702
+ follow the steps below:
704
703
705
704
1. Create a class that implements the ``WriteModelStrategy`` interface
706
705
and overrides the ``createWriteModel(SinkDocument)`` method.
@@ -711,9 +710,13 @@ To create a custom ``WriteModelStrategy``:
711
710
For more information about plugin paths, see the `Confluent documentation
712
711
<https://docs.confluent.io/current/connect/managing/community.html>`__.
713
712
713
+ #. Specify your Java class in the ``mongodb.writemodel.strategy``
714
+ :ref:`configuration setting <kafka-sink-properties>`.
715
+
714
716
The following is an example of a custom write strategy. It extracts the
715
717
value of ``fullDocument`` from the value document and returns a
716
- ``ReplaceOne`` operation.
718
+ ``ReplaceOne`` operation. The ``ReplaceOne`` operation replaces a document
719
+ in the MongoDB collection that matches the ID from the value document.
717
720
718
721
.. code-block:: java
719
722
You can’t perform that action at this time.
0 commit comments