Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions source/core/write-concern.txt
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,9 @@ If you specify a ``w`` value greater than the number of members that
hold a copy of the data (i.e., greater than the number of
non-:term:`arbiter` members), the operation blocks until those members
become available. This can cause the operation to block forever. To
specify a timeout threshold for the :dbcommand:`getLastError` operation,
use the ``wtimeout`` argument.
specify a timeout threshold in milliseconds for the :dbcommand:`getLastError` operation,
use the ``wtimeout`` argument. A ``wtimeout`` value of ``0``
means the operation will never time out.

See :ref:`getLastError Examples <gle-examples>` for example
invocations.
Expand Down
3 changes: 3 additions & 0 deletions source/reference/command/getLastError.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,6 @@ that resembles the following:
.. code-block:: javascript

db.runCommand( { getLastError: 1, w: 2, wtimeout:5000 } )

When ``wtimeout`` is ``0``, :method:`~db.runCommand()` waits forever.

3 changes: 2 additions & 1 deletion source/reference/connection-string.txt
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,8 @@ the: :doc:`/core/write-operations`:
.. data:: uri.wtimeoutMS

The time in milliseconds to wait for replication to succeed, as
specified in the :data:`~uri.w` option, before timing out.
specified in the :data:`~uri.w` option, before timing out. When ``wtimeoutMS`` is ``0``,
write operations will never time out.

.. data:: uri.journal

Expand Down
2 changes: 1 addition & 1 deletion source/reference/write-concern.txt
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ configure write concern requirements:

:dbcommand:`getLastError` also supports a ``wtimeout`` setting which
allows clients to specify a timeout for the write concern: if you
don't specify ``wtimeout`` and the :program:`mongod` cannot fulfill
don't specify ``wtimeout``, or if you give it a value of ``0``, and the :program:`mongod` cannot fulfill
the write concern the :dbcommand:`getLastError` will block,
potentially forever.

Expand Down