@@ -84,6 +84,7 @@ as it occurs. The printed change event resembles the
84
84
following:
85
85
86
86
.. code-block:: json
87
+ :emphasize-lines: 14-20
87
88
88
89
{
89
90
"cursor": {
@@ -130,11 +131,11 @@ You can specify the following stages in the ``pipeline`` parameter:
130
131
- ``$set``
131
132
- ``$unset``
132
133
133
- Open a Change Stream with a Pipeline Example
134
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
134
+ Match Specific events Example
135
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
135
136
136
- The following example uses the ``pipeline`` parameter to open a change stream
137
- that records only update operations:
137
+ The following example uses the ``pipeline`` parameter that includes a ``$match``
138
+ to open a change stream that only records update operations:
138
139
139
140
.. literalinclude:: /includes/read/change-streams.kt
140
141
:start-after: start-change-stream-pipeline
@@ -215,8 +216,8 @@ change, chain the ``fullDocumentBeforeChange()`` or the ``fullDocument()``
215
216
methods to the ``watch()`` method.
216
217
217
218
The **pre-image** is the full version of a document *before* a change. To include the
218
- pre-image in the change stream event, pass the ``fullDocumentBeforeChange()`` method
219
- one of the following parameters :
219
+ pre-image in the change stream event, pass one of the following options to the
220
+ ``fullDocumentBeforeChange()`` method :
220
221
221
222
- ``FullDocumentBeforeChange.WHEN_AVAILABLE``: The change event includes a pre-image of the
222
223
modified document for change events only if the pre-image is available.
@@ -225,8 +226,8 @@ one of the following parameters:
225
226
driver raises an error.
226
227
227
228
The **post-image** is the full version of a document *after* a change. To include the
228
- post-image in the change stream event, pass the ``fullDocument()`` method one of the
229
- following parameters :
229
+ post-image in the change stream event, pass one of the following options to the
230
+ ``fullDocument()`` method :
230
231
231
232
- ``FullDocument.UPDATE_LOOKUP``: The change event includes a copy of the entire changed
232
233
document from some time after the change.
@@ -237,7 +238,7 @@ following parameters:
237
238
driver raises an error.
238
239
239
240
The following example calls the ``watch()`` method on a collection and includes the post-image
240
- of updated documents by specifying the ``fullDocument`` parameter:
241
+ of updated documents in the results by specifying the ``fullDocument`` parameter:
241
242
242
243
.. literalinclude:: /includes/read/change-streams.kt
243
244
:start-after: start-change-stream-post-image
@@ -250,8 +251,7 @@ With the change stream application running, updating a document in the
250
251
``restaurants`` collection by using the :ref:`preceding update example
251
252
<kotlin-sync-change-stream-update>` prints a change event resembling the following:
252
253
253
-
254
- .. code-block:: sh
254
+ .. code-block:: none
255
255
256
256
ChangeStreamDocument{ operationType=update, resumeToken={"_data": "..."},
257
257
namespace=sample_restaurants.restaurants, destinationNamespace=null, fullDocument=Restaurant(name=Blarney Castle, cuisine=Irish),
0 commit comments