Skip to content

Commit 8b51c90

Browse files
authored
(DOCS-10329 & DOCS-10125): Improve getMore maxTimeMS description (#3771) (#4008)
* Improve getMore maxTimeMS description * Apply tech review feedback * Apply second round tech review feedback
1 parent 01f5378 commit 8b51c90

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

source/reference/command/getMore.txt

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,25 @@ The command accepts the following fields:
6767
- non-negative integer
6868
- Optional.
6969

70-
The maximum amount of time MongoDB waits for new documents to be
71-
added to the cursor for the current ``getMore`` command. If you
72-
set ``maxTimeMS`` to 0, operations time out immediately. If
73-
unset, defaults to 1000 milliseconds.
70+
Specifies the maximum time for the server to wait for new documents
71+
that match a :ref:`tailable cursor <tailable-cursors-landing-page>`
72+
query on a :ref:`capped collection <manual-capped-collection>`.
73+
``maxTimeMS`` on a ``getMore`` for a tailable ``awaitData`` cursor is
74+
considered the same as :method:`~cursor.maxAwaitTimeMS()`.
75+
Drivers will only set this value on ``getMore`` for a tailable
76+
cursor on a capped collection with ``awaitData`` set to ``true``. Otherwise,
77+
the command that creates the cursor sets ``maxTimeMS``, which
78+
is the maximum amount of time that the initial operation, and
79+
any subsequent ``getMore`` operations, can spend cumulatively executing
80+
the query. For tailable cursors with ``awaitData`` set to ``true``,
81+
the following is true:
7482

83+
- If no value is provided, the wait time defaults to ``1`` (1000 milliseconds).
84+
- ``maxTimeMS`` on ``getMore`` specifies the maximum amount of time
85+
MongoDB waits for new documents to be inserted into the capped
86+
collection for that specific ``getMore`` command.
87+
- ``maxTimeMS`` is set individually by the driver for each call to ``getMore``.
88+
7589
MongoDB terminates operations that exceed their allotted time limit
7690
using the same mechanism as :method:`db.killOp()`. MongoDB only
7791
terminates an operation at one of its designated :term:`interrupt points <interrupt point>`.

0 commit comments

Comments
 (0)