Skip to content
Merged
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
36 changes: 36 additions & 0 deletions source/reference/parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2615,6 +2615,42 @@ Sharding Parameters

- MongoDB 3.4.11+

.. parameter:: opportunisticSecondaryTargeting

.. versionadded:: 4.2.13

|mongos-only|

Type: boolean

Default: false

When ``true``, enables a :binary:`~bin.mongos` to attempt to
establish connections to multiple secondaries and direct the request
to the first secondary that accepts the connection.

.. note::

This feature was introduced in MongoDB 4.2.0 and enabled
by default. Starting in MongoDB 4.2.13, this feature is now
disabled by default. The
:parameter:`opportunisticSecondaryTargeting` parameter is
introduced alongside this change to permit re-enabling this
feature if desired.

The following enables :parameter:`opportunisticSecondaryTargeting`:

.. code-block:: sh

mongos --setParameter opportunisticSecondaryTargeting=true

The parameter may also be set using the :dbcommand:`setParameter`
command:

.. code-block:: javascript

db.adminCommand( { setParameter: 1, opportunisticSecondaryTargeting: true } )

Storage Parameters
~~~~~~~~~~~~~~~~~~

Expand Down