From 2554a15051a54fa47547ee612a86b485d2dfffe0 Mon Sep 17 00:00:00 2001 From: ian fogelman Date: Mon, 30 Aug 2021 16:16:17 -0400 Subject: [PATCH] DOCS-14765 Add Extra code examples for rs.reconfig() --- source/reference/method/rs.reconfig.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/source/reference/method/rs.reconfig.txt b/source/reference/method/rs.reconfig.txt index 1588a7e4fcd..2ad4bd47de8 100644 --- a/source/reference/method/rs.reconfig.txt +++ b/source/reference/method/rs.reconfig.txt @@ -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 @@ -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()`