1+ .. _kafka-source-change-streams:
2+
13==============
24Change Streams
35==============
@@ -14,14 +16,14 @@ Overview
1416--------
1517
1618In this guide, you can learn about **change streams** and how they are
17- used in a {+mkc+} source connector.
19+ used in a {+mkc+} source connector.
1820
1921Change Streams
2022--------------
2123
2224Change streams are a feature of MongoDB that allow you to receive real-time
2325updates on data changes. Change streams return
24- **change event documents**. A change event document is a document in your
26+ **change event documents**. A change event document is a document in your
2527**oplog** that contains idempotent instructions to recreate a change that
2628occurred in your MongoDB deployment as well as the metadata related to that
2729change.
@@ -36,24 +38,35 @@ works.
3638 Change streams are available for replica sets and sharded clusters. A
3739 standalone MongoDB instance cannot produce a change stream.
3840
39- For more information on change streams, see the following MongoDB manual entries:
41+ For more information on the oplog, see the MongoDB manual entry on the
42+ :manual:`Replica Set Oplog </core/replica-set-oplog/>`.
43+
44+ You can use an aggregation pipeline to modify change stream events in one or
45+ more of the following ways:
46+
47+ - Filter change events by operation type
48+ - Project specific fields
49+ - Update the value of fields
50+ - Add additional fields
51+ - Trim the amount of data generated by the change stream
4052
41- - :manual:`Change streams </changeStreams/>`
42- - :manual:`Oplog </core/replica-set-oplog/>`
53+ For a list of aggregation operators you can use with a change stream, see
54+ the guide on :manual:`Modify Change Stream Output <changeStreams/#modify-change-stream-output>`
55+ in the MongoDB manual.
4356
4457Change Event Structure
4558~~~~~~~~~~~~~~~~~~~~~~
4659
4760You can find the complete structure of change event documents, including
48- descriptions of all fields,
49- :ref:`in the MongoDB manual <change-stream-output>`.
61+ descriptions of all fields,
62+ :ref:`in the MongoDB manual <change-stream-output>`.
5063
5164.. note:: The Full Document Option
5265
5366 If you want Kafka Connect to receive just the document created or modified
5467 from your change operation, use the ``publish.full.document.only=true``
55- option. For more information see our
56- guide on <TODO: Link to source connector properties> .
68+ option. For more information, see the :ref:`<source-configuration-change-stream>`
69+ page .
5770
5871Source Connectors
5972-----------------
@@ -67,7 +80,7 @@ connector closes its change stream when you stop it.
6780
6881 Your source connector uses the MongoDB Java driver to create a change
6982 stream. For more information, see this guide on change streams in the MongoDB
70- java driver. <TODO: Link to Watch For Changes Usage Example>
83+ Java driver. <TODO: Link to Watch For Changes Usage Example>
7184
7285Resume Tokens
7386~~~~~~~~~~~~~
@@ -76,7 +89,7 @@ Your connector stores a **resume token** to keep track of what changes
7689it has processed. A resume token is a piece of data that references
7790the ``_id`` field of a change event document in your MongoDB oplog.
7891Your connector only processes relevant change event documents written to the oplog after the
79- document referenced by its resume token.
92+ document referenced by its resume token.
8093
8194If your source connector does not have a resume token, such as when you start
8295the connector for the first time, your connector processes relevant change
@@ -89,5 +102,5 @@ events written to the oplog after it first connects to MongoDB.
89102
90103If your source connector's resume token does not correspond to any entry in your
91104oplog, your connector has an invalid resume token. To learn how to recover from an
92- invalid resume token,
105+ invalid resume token,
93106:ref:`see our troubleshooting guide <kafka-troubleshoot-recover-invalid-resume-token>`.
0 commit comments