Skip to content

DOCS-14180 replica sets should use setDefaultRWConcern to modify defa… #4981

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions source/core/replica-set-write-concern.txt
Original file line number Diff line number Diff line change
Expand Up @@ -110,21 +110,8 @@ documentation on write concern, see :ref:`write-concern`.
Modify Default Write Concern
----------------------------

.. 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
</reference/replica-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)
You can modify the default write concern for a replica set by issuing
the :dbcommand:`setDefaultRWConcern` command.

If you issue a write operation with a specific write concern, the write
operation uses its own write concern instead of the default.
Expand Down