@@ -65,20 +65,11 @@ classes:
6565- ``Collection``: To monitor changes in the collection
6666
6767The following example opens a change stream on the ``restaurants`` collection
68- and outputs the changes as they occur. Select the
69- :guilabel:`Asynchronous` or :guilabel:`Synchronous` tab to see the corresponding
70- code.
68+ and outputs the changes as they occur. Select the :guilabel:`Synchronous` or
69+ :guilabel:`Asynchronous` tab to see the corresponding code.
7170
7271.. tabs::
7372
74- .. tab:: Asynchronous
75- :tabid: change-stream-async
76-
77- .. literalinclude:: /includes/code-examples/change-streams/change-streams.cs
78- :start-after: start-open-change-stream-async
79- :end-before: end-open-change-stream-async
80- :language: csharp
81-
8273 .. tab:: Synchronous
8374 :tabid: change-stream-sync
8475
8778 :end-before: end-open-change-stream
8879 :language: csharp
8980
81+ .. tab:: Asynchronous
82+ :tabid: change-stream-async
83+
84+ .. literalinclude:: /includes/code-examples/change-streams/change-streams.cs
85+ :start-after: start-open-change-stream-async
86+ :end-before: end-open-change-stream-async
87+ :language: csharp
88+
9089To begin watching for changes, run the application. Then, in a separate
9190application or shell, modify the ``restaurants`` collection. Updating a document
9291that has a ``"name"`` value of ``"Blarney Castle"`` results in the following
@@ -134,20 +133,12 @@ You can specify the following aggregation stages in the ``pipeline`` parameter:
134133Monitor Update Events Example
135134~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
136135
137- The following example uses the ``pipeline`` parameter to open a change stream
138- that records only update operations. Select the :guilabel:`Asynchronous ` or :guilabel:`Synchronous ` tab to see the
139- corresponding code.
136+ The following example uses the ``pipeline`` parameter to open a change stream that records
137+ only update operations. Select the :guilabel:`Synchronous ` or :guilabel:`Asynchronous ` tab
138+ to see the corresponding code.
140139
141140.. tabs::
142141
143- .. tab:: Asynchronous
144- :tabid: change-stream-async
145-
146- .. literalinclude:: /includes/code-examples/change-streams/change-streams.cs
147- :start-after: start-change-stream-pipeline-async
148- :end-before: end-change-stream-pipeline-async
149- :language: csharp
150-
151142 .. tab:: Synchronous
152143 :tabid: change-stream-sync
153144
@@ -156,6 +147,14 @@ corresponding code.
156147 :end-before: end-change-stream-pipeline
157148 :language: csharp
158149
150+ .. tab:: Asynchronous
151+ :tabid: change-stream-async
152+
153+ .. literalinclude:: /includes/code-examples/change-streams/change-streams.cs
154+ :start-after: start-change-stream-pipeline-async
155+ :end-before: end-change-stream-pipeline-async
156+ :language: csharp
157+
159158Split Large Change Events Example
160159~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
161160
@@ -173,14 +172,6 @@ reassemble any event fragments:
173172
174173.. tabs::
175174
176- .. tab:: Asynchronous
177- :tabid: change-stream-split-async
178-
179- .. literalinclude:: /includes/code-examples/change-streams/change-streams.cs
180- :start-after: start-split-change-event-async
181- :end-before: end-split-change-event-async
182- :language: csharp
183-
184175 .. tab:: Synchronous
185176 :tabid: change-stream-split-sync
186177
@@ -189,6 +180,14 @@ reassemble any event fragments:
189180 :end-before: end-split-change-event-sync
190181 :language: csharp
191182
183+ .. tab:: Asynchronous
184+ :tabid: change-stream-split-async
185+
186+ .. literalinclude:: /includes/code-examples/change-streams/change-streams.cs
187+ :start-after: start-split-change-event-async
188+ :end-before: end-split-change-event-async
189+ :language: csharp
190+
192191.. note::
193192
194193 We recommend reassembling change event fragments, as shown in the
@@ -202,6 +201,14 @@ The following code defines these methods:
202201
203202.. tabs::
204203
204+ .. tab:: Synchronous
205+ :tabid: split-event-helpers-sync
206+
207+ .. literalinclude:: /includes/code-examples/change-streams/change-streams.cs
208+ :start-after: start-split-event-helpers-sync
209+ :end-before: end-split-event-helpers-sync
210+ :language: csharp
211+
205212 .. tab:: Asynchronous
206213 :tabid: split-event-helpers-async
207214
@@ -210,14 +217,6 @@ The following code defines these methods:
210217 :end-before: end-split-event-helpers-async
211218 :language: csharp
212219
213- .. tab:: Synchronous
214- :tabid: split-event-helpers-sync
215-
216- .. literalinclude:: /includes/code-examples/change-streams/change-streams.cs
217- :start-after: start-split-event-helpers-sync
218- :end-before: end-split-event-helpers-sync
219- :language: csharp
220-
221220.. tip::
222221
223222 To learn more about splitting large change events, see
@@ -344,19 +343,11 @@ one of the following values:
344343
345344The following example opens a change stream on a collection and includes the post-image
346345of updated documents by specifying the ``FullDocument`` option. Select the
347- :guilabel:`Asynchronous ` or :guilabel:`Synchronous ` tab to see the corresponding
346+ :guilabel:`Synchronous ` or :guilabel:`Asynchronous ` tab to see the corresponding
348347code.
349348
350349.. tabs::
351350
352- .. tab:: Asynchronous
353- :tabid: change-stream-async
354-
355- .. literalinclude:: /includes/code-examples/change-streams/change-streams.cs
356- :start-after: start-change-stream-post-image-async
357- :end-before: end-change-stream-post-image-async
358- :language: csharp
359-
360351 .. tab:: Synchronous
361352 :tabid: change-stream-sync
362353
@@ -365,6 +356,14 @@ code.
365356 :end-before: end-change-stream-post-image
366357 :language: csharp
367358
359+ .. tab:: Asynchronous
360+ :tabid: change-stream-async
361+
362+ .. literalinclude:: /includes/code-examples/change-streams/change-streams.cs
363+ :start-after: start-change-stream-post-image-async
364+ :end-before: end-change-stream-post-image-async
365+ :language: csharp
366+
368367Running the preceding code example and updating a document that has a ``"name"``
369368value of ``"Blarney Castle"`` results in the following change stream output:
370369
0 commit comments