Skip to content

Commit d9362cf

Browse files
committed
Revert "TEMP: remove C# from changestreams"
This reverts commit ec40086.
1 parent fb4ea29 commit d9362cf

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

source/tutorial/change-streams-example.txt

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Change Stream Examples
2424

2525

2626

27+
2728
.. contents:: On this page
2829
:local:
2930
:backlinks: none
@@ -47,6 +48,12 @@ Change Stream Examples
4748
<http://mongodb.github.io/mongo-java-driver/3.6/driver/tutorials/databases-collections/>`_
4849
that contains an ``inventory`` collection.
4950

51+
- id: csharp
52+
content: |
53+
The examples below assume that you have `connected to a MongoDB replica set and have accessed a database
54+
<http://mongodb.github.io/mongo-csharp-driver/2.4/getting_started/quick_tour/#make-a-connection/>`_
55+
that contains an ``inventory`` collection.
56+
5057
- id: c
5158
content: |
5259
The examples below assume that you have `connected to a MongoDB replica set and have accessed a database
@@ -85,6 +92,15 @@ as long as a connection to the MongoDB deployment remains open *and* the collect
8592
:dedent: 8
8693
:start-after: Start Changestream Example 1
8794
:end-before: End Changestream Example 1
95+
96+
- id: csharp
97+
content: |
98+
.. class:: copyable-code
99+
.. literalinclude:: /driver-examples/ChangeStreamExamples.cs
100+
:language: c#
101+
:dedent: 12
102+
:start-after: Start Changestream Example 1
103+
:end-before: End Changestream Example 1
88104

89105
- id: c
90106
content: |
@@ -131,6 +147,13 @@ Lookup Full Document for Update Operations
131147
To return the most current majority-committed version of the updated
132148
document, pass the ``"fullDocument"`` option with the ``"updateLookup"`` value to the
133149
:method:`mongoc_collection_watch` method.
150+
151+
- id: csharp
152+
content: |
153+
By default, change streams only return the delta of fields during the update operation.
154+
To return the most current majority-committed version of the updated
155+
document, pass ``"FullDocument = ChangeStreamFullDocumentOption.UpdateLookup"`` to the
156+
:method:`collection.Watch()` method.
134157

135158

136159
If there are one or more majority-committed operations that modified the
@@ -170,6 +193,16 @@ update operation.
170193
:dedent: 8
171194
:start-after: Start Changestream Example 2
172195
:end-before: End Changestream Example 2
196+
197+
- id: csharp
198+
content: |
199+
.. class:: copyable-code
200+
201+
.. literalinclude:: /driver-examples/ChangeStreamExamples.cs
202+
:language: C#
203+
:dedent: 12
204+
:start-after: Start Changestream Example 2
205+
:end-before: End Changestream Example 2
173206

174207
- id: c
175208
content: |
@@ -281,6 +314,22 @@ notification after a specific notification.
281314
:dedent: 8
282315
:start-after: Start Changestream Example 3
283316
:end-before: End Changestream Example 3
317+
318+
- id: csharp
319+
content: |
320+
In the example below, the ``resumeToken`` is retrieved from the last change stream document
321+
and passed to the ``Watch()`` method as an option. Passing the ``resumeToken``
322+
to the ``Watch()`` method directs
323+
the change stream to attempt to resume notifications starting at the
324+
operation specified in the resume token.
325+
326+
.. class:: copyable-code
327+
328+
.. literalinclude:: /driver-examples/ChangeStreamExamples.cs
329+
:language: C#
330+
:dedent: 12
331+
:start-after: Start Changestream Example 3
332+
:end-before: End Changestream Example 3
284333

285334
- id: c
286335
content: |

0 commit comments

Comments
 (0)