Skip to content

Commit 2554a15

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

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

source/reference/method/rs.reconfig.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,9 @@ A replica set named ``rs0`` has the following configuration:
307307
}
308308
}
309309

310+
Change Replica Set Member Priority
311+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
312+
310313
The following sequence of operations updates the
311314
:rsconf:`members[n].priority` of the second member. The operations are
312315
issued through a :binary:`~bin.mongosh` session that is connected to
@@ -402,6 +405,24 @@ the primary.
402405
}
403406
}
404407

408+
Change Replica Set Settings
409+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
410+
411+
You can also modify the cluster replica set :rsconf:`settings` document.
412+
The :rsconf:`settings` document contains configuration options that
413+
apply to the whole replica set.
414+
415+
The following sequence of operations updates the
416+
:rsconf:`settings.heartbeatTimeoutSecs` of the cluster to ``15``.
417+
The operations are issued through a :binary:`~bin.mongosh` session
418+
that is connected to the primary.
419+
420+
.. code-block:: javascript
421+
422+
cfg = rs.conf();
423+
cfg.settings.heartbeatTimeoutSecs = 15;
424+
rs.reconfig(cfg);
425+
405426
.. seealso::
406427

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

0 commit comments

Comments
 (0)