Skip to content

Commit

Permalink
DOCS-14765 Add Extra code examples for rs.reconfig()
Browse files Browse the repository at this point in the history
  • Loading branch information
ianf-mongodb authored and npentrel committed Sep 8, 2021
1 parent ed09d41 commit 2554a15
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions source/reference/method/rs.reconfig.txt
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ A replica set named ``rs0`` has the following configuration:
}
}

Change Replica Set Member Priority
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The following sequence of operations updates the
:rsconf:`members[n].priority` of the second member. The operations are
issued through a :binary:`~bin.mongosh` session that is connected to
Expand Down Expand Up @@ -402,6 +405,24 @@ the primary.
}
}

Change Replica Set Settings
~~~~~~~~~~~~~~~~~~~~~~~~~~~

You can also modify the cluster replica set :rsconf:`settings` document.
The :rsconf:`settings` document contains configuration options that
apply to the whole replica set.

The following sequence of operations updates the
:rsconf:`settings.heartbeatTimeoutSecs` of the cluster to ``15``.
The operations are issued through a :binary:`~bin.mongosh` session
that is connected to the primary.

.. code-block:: javascript

cfg = rs.conf();
cfg.settings.heartbeatTimeoutSecs = 15;
rs.reconfig(cfg);

.. seealso::

- :method:`rs.conf()`
Expand Down

0 comments on commit 2554a15

Please sign in to comment.