@@ -15,13 +15,44 @@ Overview
15
15
16
16
.. _sink-configuration-write-model-strategy-description-start:
17
17
18
- Use the strategies in the following table to specify how the {+sink-connector+}
19
- writes data into MongoDB. You can specify a write strategy with the following
18
+ You can set configuration properties to specify how the
19
+ {+sink-connector+} writes data into MongoDB. The following sections
20
+ describe the configuration properties that you can set to customize this
21
+ behavior.
22
+
23
+ Write Model
24
+ ~~~~~~~~~~~
25
+
26
+ Set the ``writemodel.strategy`` configuration property to specify how
27
+ the sink connector writes data when it receives a sink record.
28
+
29
+ You can set the value of ``writemodel.strategy`` to any of the
30
+ fully qualified class names of the write model strategies described in
31
+ the :ref:`Strategies <sink-connector-write-model-strategies>` section of
32
+ this page. You can specify a strategy by setting the following
33
+ configuration:
34
+
35
+ .. code-block:: properties
36
+
37
+ writemodel.strategy=<a write model strategy>
38
+
39
+ Delete Write Model
40
+ ~~~~~~~~~~~~~~~~~~
41
+
42
+ Set the ``delete.writemodel.strategy`` configuration property to specify
43
+ how the sink connector writes data when it receives a tombstone
44
+ event. A tombstone event is a record that contains a key but no
45
+ value, which signifies a deleted record.
46
+
47
+ You can set the value of ``delete.writemodel.strategy`` to any of the
48
+ fully qualified class names of the write model strategies described in
49
+ the :ref:`Strategies <sink-connector-write-model-strategies>` section of
50
+ this page. You can specify a strategy by setting the following
20
51
configuration:
21
52
22
53
.. code-block:: properties
23
54
24
- writemodel.strategy=<a writemodel strategy>
55
+ delete. writemodel.strategy=<a write model strategy>
25
56
26
57
.. _sink-configuration-write-model-strategy-description-end:
27
58
@@ -48,41 +79,45 @@ Strategies
48
79
default, and the ``InsertOneDefaultStrategy`` if you set the
49
80
``timeseries.timefield`` option.
50
81
|
51
- | This is the default value for the ``writemodel.strategy`` configuration setting.
82
+ | This is the default value value for the ``writemodel.strategy``
83
+ configuration property.
52
84
53
85
* - | **InsertOneDefaultStrategy**
54
86
|
55
87
- | **Description:**
56
88
| Insert each sink record into MongoDB as a document.
57
- | Apply the following configuration to your sink connector to specify this setting:
89
+ | To specify this strategy, set the configuration property to the
90
+ following class name:
58
91
59
- .. code-block:: properties
92
+ .. code-block:: none
60
93
61
- writemodel.strategy= com.mongodb.kafka.connect.sink.writemodel.strategy.InsertOneDefaultStrategy
94
+ com.mongodb.kafka.connect.sink.writemodel.strategy.InsertOneDefaultStrategy
62
95
63
96
* - | **ReplaceOneDefaultStrategy**
64
97
|
65
98
- | **Description:**
66
99
| Replaces at most one document in MongoDB that matches a sink
67
100
record by the ``_id`` field. If no documents match, the
68
101
connector inserts the sink record as a new document.
69
- | Apply the following configuration to your sink connector to specify this setting:
102
+ | To specify this strategy, set the configuration property to the
103
+ following class name:
70
104
71
- .. code-block:: properties
105
+ .. code-block:: none
72
106
73
- writemodel.strategy= com.mongodb.kafka.connect.sink.writemodel.strategy.ReplaceOneDefaultStrategy
107
+ com.mongodb.kafka.connect.sink.writemodel.strategy.ReplaceOneDefaultStrategy
74
108
75
109
* - | **ReplaceOneBusinessKeyStrategy**
76
110
|
77
111
- | **Description:**
78
112
| Replaces at most one document that matches a sink record by a
79
113
specified business key. If no documents match, the
80
114
connector inserts the sink record as a new document.
81
- | Apply the following configuration to your sink connector to specify this setting:
115
+ | To specify this strategy, set the configuration property to the
116
+ following class name:
82
117
83
- .. code-block:: properties
118
+ .. code-block:: none
84
119
85
- writemodel.strategy= com.mongodb.kafka.connect.sink.writemodel.strategy.ReplaceOneBusinessKeyStrategy
120
+ com.mongodb.kafka.connect.sink.writemodel.strategy.ReplaceOneBusinessKeyStrategy
86
121
87
122
| To see an example showing how to use this strategy, see our
88
123
:ref:`guide on write model strategies <kafka-sink-write-model-replace-example>`.
@@ -93,22 +128,30 @@ Strategies
93
128
| Deletes at most one document that matches your sink connector's
94
129
key structure by the ``_id`` field only when the document
95
130
contains a null value structure.
96
- | This is implicitly specified when you set ``mongodb.delete.on.null.values=true``.
97
- | You can set this explicitly with the following configuration:
131
+ |
132
+ | This is the default value for the
133
+ ``delete.writemodel.strategy`` configuration property.
134
+ |
135
+ | This strategy is set as the default value of the
136
+ ``writemodel.strategy`` property when you set
137
+ ``mongodb.delete.on.null.values=true``.
138
+ | To specify this strategy, set the configuration property to the
139
+ following class name:
98
140
99
- .. code-block:: properties
141
+ .. code-block:: none
100
142
101
- writemodel.strategy= com.mongodb.kafka.connect.sink.writemodel.strategy.DeleteOneDefaultStrategy
143
+ com.mongodb.kafka.connect.sink.writemodel.strategy.DeleteOneDefaultStrategy
102
144
103
145
* - | **DeleteOneBusinessKeyStrategy**
104
146
|
105
147
- | **Description:**
106
148
| Deletes at most one MongoDB document that matches a sink record by a business key.
107
- | Apply the following configuration to your sink connector to specify this setting:
149
+ | To specify this strategy, set the configuration property to the
150
+ following class name:
108
151
109
- .. code-block:: properties
152
+ .. code-block:: none
110
153
111
- writemodel.strategy= com.mongodb.kafka.connect.sink.writemodel.strategy.DeleteOneBusinessKeyStrategy
154
+ com.mongodb.kafka.connect.sink.writemodel.strategy.DeleteOneBusinessKeyStrategy
112
155
113
156
| To see an example showing how to use this strategy, see our
114
157
:ref:`guide on write model strategies <kafka-sink-write-model-delete-example>`.
@@ -119,21 +162,23 @@ Strategies
119
162
| Updates at most one document in MongoDB that matches a sink
120
163
record by the ``_id`` field. If no documents match, the
121
164
connector inserts the sink record as a new document.
122
- | Apply the following configuration to your sink connector to specify this setting:
123
-
124
- .. code-block:: properties
165
+ | To specify this strategy, set the configuration property to the
166
+ following class name:
167
+
168
+ .. code-block:: none
125
169
126
- writemodel.strategy= com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneDefaultStrategy
170
+ com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneDefaultStrategy
127
171
128
172
* - | **UpdateOneTimestampsStrategy**
129
173
|
130
174
- | **Description:**
131
175
| Add ``_insertedTS`` (inserted timestamp) and ``_modifiedTS`` (modified timestamp) fields into documents.
132
- | Apply the following configuration to your sink connector to specify this setting:
133
-
134
- .. code-block:: properties
135
-
136
- writemodel.strategy=com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneTimestampsStrategy
176
+ | To specify this strategy, set the configuration property to the
177
+ following class name:
178
+
179
+ .. code-block:: none
180
+
181
+ com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneTimestampsStrategy
137
182
138
183
| To see an example showing how to use this strategy, see our
139
184
:ref:`guide on write model strategies <kafka-sink-write-model-time-example>`.
@@ -144,10 +189,11 @@ Strategies
144
189
| Add ``_insertedTS`` (inserted timestamp) and ``_modifiedTS``
145
190
(modified timestamp) fields into documents that match a business
146
191
key.
147
- | Apply the following configuration to your sink connector to specify this setting:
148
-
149
- .. code-block:: properties
192
+ | To specify this strategy, set the configuration property to the
193
+ following class name:
194
+
195
+ .. code-block:: none
150
196
151
- writemodel.strategy= com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneBusinessKeyTimestampStrategy
197
+ com.mongodb.kafka.connect.sink.writemodel.strategy.UpdateOneBusinessKeyTimestampStrategy
152
198
153
- .. _sink-configuration-write-model-strategy-table-end:
199
+ .. _sink-configuration-write-model-strategy-table-end:
0 commit comments