Skip to content

Commit 44b5830

Browse files
authored
DOCSP-51959 Add a warning about tryNext bug to all change stream manual iteration examples (#1189) (#1192)
* DOCSP-51959 tryNext resumeToken error warning * fix link * bracket removal * move warning (cherry picked from commit 7baddf7)
1 parent 83d0bf0 commit 44b5830

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

source/includes/try-next-warning.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.. warning::
2+
3+
The `tryNext() <{+api+}/classes/ChangeStream.html#tryNext>`_ method does not
4+
automatically update the change stream's `resumeToken.
5+
<{+api+}/classes/ChangeStream.html#resumeToken>`_ If you require an updated
6+
``resumeToken``, use the ``next()`` method.

source/monitoring-and-logging/change-streams.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ section for more information on the settings you can configure with this object.
6060
The ``watch()`` method returns an instance of a `ChangeStream <{+api+}/classes/ChangeStream.html>`__. You can read events from
6161
change streams by iterating over them or listening for events.
6262

63+
.. include:: /includes/changestream-paradigm-warning.rst
64+
6365
Select the tab that corresponds to the way you want to
6466
read events from the change stream:
6567

@@ -88,6 +90,7 @@ read events from the change stream:
8890
- ``next()`` to request the next document in the stream
8991
- ``close()`` to close the ChangeStream
9092

93+
.. include:: /includes/try-next-warning.rst
9194

9295
.. tab::
9396
:tabid: Event
@@ -114,7 +117,7 @@ read events from the change stream:
114117

115118
changeStream.close();
116119

117-
.. include:: /includes/changestream-paradigm-warning.rst
120+
.. _node-usage-watch:
118121

119122
Examples
120123
--------

0 commit comments

Comments
 (0)