diff --git a/source/reference/glossary.txt b/source/reference/glossary.txt index e7a1ae30193..9c2bd11b0a1 100644 --- a/source/reference/glossary.txt +++ b/source/reference/glossary.txt @@ -208,9 +208,11 @@ Glossary cursor A pointer to the result set of a :term:`query`. Clients can - iterate through a cursor to retrieve results. By default, cursors - timeout after 10 minutes of inactivity. See - :ref:`read-operations-cursors`. + iterate through a cursor to retrieve results. By default, cursors + not opened within a session automatically timeout after 10 + minutes of inactivity. Cursors opened under a session close with + the end or timeout of the session. + See :ref:`read-operations-cursors`. daemon The conventional name for a background, non-interactive diff --git a/source/tutorial/iterate-a-cursor.txt b/source/tutorial/iterate-a-cursor.txt index 666bec9deb8..c7420252402 100644 --- a/source/tutorial/iterate-a-cursor.txt +++ b/source/tutorial/iterate-a-cursor.txt @@ -118,13 +118,26 @@ The ``myCursor[1]`` is equivalent to the following example: Cursor Behaviors ---------------- -Closure of Inactive Cursors -~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Cursors Opened Within a Session +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -By default, the server will automatically close the cursor after 10 -minutes of inactivity, or if client has exhausted the cursor. To -override this behavior in the :binary:`~bin.mongo` shell, you can use -the :method:`cursor.noCursorTimeout()` method: +Starting in MongoDB 4.4.8, cursors created within a +:doc:`client session ` close +when the corresponding :doc:`server session ` +ends with the :dbcommand:`killSessions` command, if the session times +out, or if the client has exhausted the cursor. + +By default, server sessions have an expiration timeout of 30 minutes. To +change the value, set the :parameter:`localLogicalSessionTimeoutMinutes` +parameter when starting up :binary:`~bin.mongod`. + +Cursors Opened Outside of a Session +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Cursors that aren't opened under a session automatically close after 10 +minutes of inactivity, or if client has exhausted the cursor. To +override this behavior in :binary:`~bin.mongosh`, you can use the +:method:`cursor.noCursorTimeout()` method: .. code-block:: javascript @@ -135,6 +148,7 @@ manually with :method:`cursor.close()` or by exhausting the cursor's results. See your :driver:`driver ` documentation for information on setting the ``noCursorTimeout`` option. + .. _cursor-isolation: