From 4d3aa2eec09a3a97caa45656daf9201a797f0df9 Mon Sep 17 00:00:00 2001 From: Melanie Ballard Date: Thu, 17 Jul 2025 11:43:13 -0400 Subject: [PATCH 1/4] DOCSP-51959 tryNext resumeToken error warning --- source/includes/try-next-warning.rst | 6 ++++++ source/monitoring-and-logging/change-streams.txt | 1 + 2 files changed, 7 insertions(+) create mode 100644 source/includes/try-next-warning.rst diff --git a/source/includes/try-next-warning.rst b/source/includes/try-next-warning.rst new file mode 100644 index 000000000..dc4b6b4b8 --- /dev/null +++ b/source/includes/try-next-warning.rst @@ -0,0 +1,6 @@ +.. warning:: Outdated resumeToken with ``tryNext()`` + + The `tryNext() <{+api+}/classes/ChangeStream.html#tryNext>`_ method does not + automatically update the change stream's `resumeToken. + <{+api+/classes/ChangeStream.html#resumeToken}>`_ If you require an updated + ``resumeToken``, use the ``next()`` method. \ No newline at end of file diff --git a/source/monitoring-and-logging/change-streams.txt b/source/monitoring-and-logging/change-streams.txt index d0c573eb0..554d9f044 100644 --- a/source/monitoring-and-logging/change-streams.txt +++ b/source/monitoring-and-logging/change-streams.txt @@ -88,6 +88,7 @@ read events from the change stream: - ``next()`` to request the next document in the stream - ``close()`` to close the ChangeStream + .. include:: /includes/try-next-warning.rst .. tab:: :tabid: Event From cd70bcfbaf1ee560a4088151d2e5c960d56897dc Mon Sep 17 00:00:00 2001 From: Melanie Ballard Date: Thu, 17 Jul 2025 13:34:19 -0400 Subject: [PATCH 2/4] fix link --- source/includes/try-next-warning.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/includes/try-next-warning.rst b/source/includes/try-next-warning.rst index dc4b6b4b8..493c8d48d 100644 --- a/source/includes/try-next-warning.rst +++ b/source/includes/try-next-warning.rst @@ -1,6 +1,6 @@ -.. warning:: Outdated resumeToken with ``tryNext()`` +.. warning:: The `tryNext() <{+api+}/classes/ChangeStream.html#tryNext>`_ method does not automatically update the change stream's `resumeToken. - <{+api+/classes/ChangeStream.html#resumeToken}>`_ If you require an updated + <{+api+}/classes/ChangeStream.html#resumeToken}>`_ If you require an updated ``resumeToken``, use the ``next()`` method. \ No newline at end of file From 1ef168a97d66ae756c210fcb327d56be54379c0c Mon Sep 17 00:00:00 2001 From: Melanie Ballard Date: Thu, 17 Jul 2025 15:39:40 -0400 Subject: [PATCH 3/4] bracket removal --- source/includes/try-next-warning.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/includes/try-next-warning.rst b/source/includes/try-next-warning.rst index 493c8d48d..800ba355e 100644 --- a/source/includes/try-next-warning.rst +++ b/source/includes/try-next-warning.rst @@ -2,5 +2,5 @@ The `tryNext() <{+api+}/classes/ChangeStream.html#tryNext>`_ method does not automatically update the change stream's `resumeToken. - <{+api+}/classes/ChangeStream.html#resumeToken}>`_ If you require an updated + <{+api+}/classes/ChangeStream.html#resumeToken>`_ If you require an updated ``resumeToken``, use the ``next()`` method. \ No newline at end of file From aaf19e627e08ccc9fe5c065a558749fe5893ef7d Mon Sep 17 00:00:00 2001 From: Melanie Ballard Date: Thu, 17 Jul 2025 15:52:22 -0400 Subject: [PATCH 4/4] move warning --- source/monitoring-and-logging/change-streams.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/monitoring-and-logging/change-streams.txt b/source/monitoring-and-logging/change-streams.txt index 554d9f044..8bf724333 100644 --- a/source/monitoring-and-logging/change-streams.txt +++ b/source/monitoring-and-logging/change-streams.txt @@ -60,6 +60,8 @@ section for more information on the settings you can configure with this object. The ``watch()`` method returns an instance of a `ChangeStream <{+api+}/classes/ChangeStream.html>`__. You can read events from change streams by iterating over them or listening for events. +.. include:: /includes/changestream-paradigm-warning.rst + Select the tab that corresponds to the way you want to read events from the change stream: @@ -115,8 +117,6 @@ read events from the change stream: changeStream.close(); -.. include:: /includes/changestream-paradigm-warning.rst - .. _node-usage-watch: Examples