From 61585fd3b063b9b979ffb40367b8ffb799e1bac2 Mon Sep 17 00:00:00 2001 From: Andrew Feierabend Date: Wed, 24 Feb 2021 10:54:09 -0500 Subject: [PATCH] Revert "DOCS-14180 replica sets should use setDefaultRWConcern to modify default write concern" This reverts commit 7564c3b49153c8629ac95bec482c4db950e246a7. --- source/core/replica-set-write-concern.txt | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/source/core/replica-set-write-concern.txt b/source/core/replica-set-write-concern.txt index ddada79ba3f..811c4de96f4 100644 --- a/source/core/replica-set-write-concern.txt +++ b/source/core/replica-set-write-concern.txt @@ -110,8 +110,21 @@ documentation on write concern, see :ref:`write-concern`. Modify Default Write Concern ---------------------------- -You can modify the default write concern for a replica set by issuing -the :dbcommand:`setDefaultRWConcern` command. +.. TODO need to remove most of this section and rewrite what's left. + Post 2.6 though. + +You can modify the default write concern for a replica set by setting +the :rsconf:`settings.getLastErrorDefaults` setting +in the :doc:`replica set configuration +`. The following sequence of commands +creates a configuration that waits for the write operation to complete +on a majority of the voting members before returning: + +.. code-block:: javascript + + cfg = rs.conf() + cfg.settings.getLastErrorDefaults = { w: "majority", wtimeout: 5000 } + rs.reconfig(cfg) If you issue a write operation with a specific write concern, the write operation uses its own write concern instead of the default.