Skip to content

Commit b2b1bfe

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

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

source/reference/method/rs.reconfig.txt

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,9 @@ A replica set named ``rs0`` has the following configuration:
180180
}
181181
}
182182

183+
Change Replica Set Member Priority
184+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
185+
183186
The following sequence of operations updates the
184187
:rsconf:`members[n].priority` of the second member.
185188
The operations are issued through a :binary:`~bin.mongo` shell connected to
@@ -275,7 +278,25 @@ the primary.
275278
}
276279
}
277280

278-
.. seealso::
281+
Change Replica Set Settings
282+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
283+
284+
You can also modify the cluster replica set :rsconf:`settings` document.
285+
The :rsconf:`settings` document contains configuration options that
286+
apply to the whole replica set.
287+
288+
The following sequence of operations updates the
289+
:rsconf:`settings.heartbeatTimeoutSecs` of the cluster to ``15``.
290+
The operations are issued through a :binary:`~bin.mongosh` session
291+
that is connected to the primary.
292+
293+
.. code-block:: javascript
294+
295+
cfg = rs.conf();
296+
cfg.settings.heartbeatTimeoutSecs = 15;
297+
rs.reconfig(cfg);
298+
299+
.. seealso::
279300

280301
- :method:`rs.conf()`
281302

0 commit comments

Comments
 (0)