@@ -118,13 +118,26 @@ The ``myCursor[1]`` is equivalent to the following example:
118
118
Cursor Behaviors
119
119
----------------
120
120
121
- Closure of Inactive Cursors
122
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
121
+ Cursors Opened Within a Session
122
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
123
123
124
- By default, the server will automatically close the cursor after 10
125
- minutes of inactivity, or if client has exhausted the cursor. To
126
- override this behavior in :binary:`~bin.mongosh`, you can use
127
- the :method:`cursor.noCursorTimeout()` method:
124
+ Starting in MongoDB 5.0 (and 4.4.8), cursors created within a
125
+ :doc:`client session </core/read-isolation-consistency-recency>` close
126
+ when the corresponding :doc:`server session </reference/server-sessions>`
127
+ ends with the :dbcommand:`killSessions` command, if the session times
128
+ out, or if the client has exhausted the cursor.
129
+
130
+ By default, server sessions have an expiration timeout of 30 minutes. To
131
+ change the value, set the :parameter:`localLogicalSessionTimeoutMinutes`
132
+ parameter when starting up :binary:`~bin.mongod`.
133
+
134
+ Cursors Opened Outside of a Session
135
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
136
+
137
+ Cursors that aren't opened under a session automatically close after 10
138
+ minutes of inactivity, or if client has exhausted the cursor. To
139
+ override this behavior in :binary:`~bin.mongosh`, you can use the
140
+ :method:`cursor.noCursorTimeout()` method:
128
141
129
142
.. code-block:: javascript
130
143
@@ -135,6 +148,7 @@ manually with :method:`cursor.close()` or by exhausting the cursor's results.
135
148
136
149
See your :driver:`driver </>` documentation for
137
150
information on setting the ``noCursorTimeout`` option.
151
+
138
152
139
153
.. _cursor-isolation:
140
154
0 commit comments