Skip to content

Commit 514fa04

Browse files
ianf-mongodbnpentrel
authored andcommitted
DOCS-14765 Add Extra code examples for rs.reconfig()
1 parent 1d023ad commit 514fa04

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

source/reference/method/rs.reconfig.txt

+21
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ A replica set named ``rs0`` has the following configuration:
298298
}
299299
}
300300

301+
Change Replica Set Member Priority
302+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
303+
301304
The following sequence of operations updates the
302305
:rsconf:`members[n].priority` of the second member.
303306
The operations are issued through a :binary:`~bin.mongo` shell connected to
@@ -393,6 +396,24 @@ the primary.
393396
}
394397
}
395398

399+
Change Replica Set Settings
400+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
401+
402+
You can also modify the cluster replica set :rsconf:`settings` document.
403+
The :rsconf:`settings` document contains configuration options that
404+
apply to the whole replica set.
405+
406+
The following sequence of operations updates the
407+
:rsconf:`settings.heartbeatTimeoutSecs` of the cluster to ``15``.
408+
The operations are issued through a :binary:`~bin.mongosh` session
409+
that is connected to the primary.
410+
411+
.. code-block:: javascript
412+
413+
cfg = rs.conf();
414+
cfg.settings.heartbeatTimeoutSecs = 15;
415+
rs.reconfig(cfg);
416+
396417
.. seealso::
397418

398419
- :method:`rs.conf()`

0 commit comments

Comments
 (0)