@@ -106,10 +106,10 @@ Modify the Change Stream Output
106106
107107You can pass the ``pipeline`` parameter to the ``Watch()`` and ``WatchAsync()``
108108methods to modify the change stream output. This parameter allows you to watch
109- for only specified change events. Format the parameter as a list of objects that
110- each represent an aggregation stage.
109+ for only specified change events. Create the pipeline by using the
110+ ``EmptyPipelineDefinition`` class, and appending the relevant aggregation stage methods .
111111
112- You can specify the following stages in the ``pipeline`` parameter:
112+ You can specify the following aggregation stages in the ``pipeline`` parameter:
113113
114114- ``$addFields``
115115- ``$match``
@@ -120,6 +120,9 @@ You can specify the following stages in the ``pipeline`` parameter:
120120- ``$set``
121121- ``$unset``
122122
123+ To learn how to build an aggregation pipeline by using the
124+ ``PipelineDefinitionBuilder`` class, see :ref:`csharp-builders-aggregation`.
125+
123126The following example uses the ``pipeline`` parameter to open a change stream
124127that records only update operations. Select the :guilabel:`Asynchronous` or :guilabel:`Synchronous` tab to see the
125128corresponding code.
@@ -150,7 +153,7 @@ manual.
150153Modify ``Watch()`` Behavior
151154---------------------------
152155
153- The ``Watch()`` and ``WatchAsync`` methods accept optional parameters, which represent
156+ The ``Watch()`` and ``WatchAsync() `` methods accept optional parameters, which represent
154157options you can use to configure the operation. If you don't specify any
155158options, the driver does not customize the operation.
156159
@@ -237,23 +240,25 @@ The **pre-image** is the full version of a document *before* a change. To includ
237240pre-image in the change stream event, set the ``FullDocumentBeforeChange``
238241parameter to one of the following values:
239242
240- - ``WhenAvailable``: The change event includes a pre-image of the
241- modified document for change events only if the pre-image is available.
242- - ``Required``: The change event includes a pre-image of the
243- modified document for change events. If the pre-image is not available, the
244- driver raises an error.
243+ - ``ChangeStreamFullDocumentBeforeChangeOption.WhenAvailable``: The change event
244+ includes a pre-image of the modified document for change events only if the
245+ pre-image is available.
246+ - ``ChangeStreamFullDocumentBeforeChangeOption.ChangeStreamFullDocumentOption.Required``:
247+ The change event includes a pre-image of the modified document for change
248+ events. If the pre-image is not available, the driver raises an error.
245249
246250The **post-image** is the full version of a document *after* a change. To include the
247251post-image in the change stream event, set the ``full_document`` parameter to
248252one of the following values:
249253
250- - ``UpdateLookup``: The change event includes a copy of the entire changed
251- document from some time after the change.
252- - ``WhenAvailable``: The change event includes a post-image of the
253- modified document for change events only if the post-image is available.
254- - ``Required``: The change event includes a post-image of the
255- modified document for change events. If the post-image is not available, the
256- driver raises an error.
254+ - ``ChangeStreamFullDocumentOption.UpdateLookup``: The change event includes a
255+ copy of the entire changed document from some time after the change.
256+ - ``ChangeStreamFullDocumentOption.WhenAvailable``: The change event includes a
257+ post-image of the modified document for change events only if the post-image
258+ is available.
259+ - ``ChangeStreamFullDocumentOption.Required``: The change event includes a
260+ post-image of the modified document for change events. If the post-image is
261+ not available, the driver raises an error.
257262
258263The following example opens a change stream on a collection and includes the post-image
259264of updated documents by specifying the ``FullDocument`` parameter. Select the
@@ -297,4 +302,4 @@ guide, see the following API documentation:
297302- `Watch() <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.IMongoClient.Watch.html>`__
298303- `WatchAsync() <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.IMongoClient.WatchAsync.html>`__
299304- `ChangeStreamOptions <{+new-api-root+}/MongoDB.Driver/MongoDB.Driver.ChangeStreamOptions.html>`__
300- - `UpdateOne() <{+new-api-root+}MongoDB.Driver/MongoDB.Driver.IMongoCollectionExtensions.UpdateOne.html>`__
305+ - `UpdateOne() <{+new-api-root+}/ MongoDB.Driver/MongoDB.Driver.IMongoCollectionExtensions.UpdateOne.html>`__
0 commit comments