Skip to content

Commit 0050be0

Browse files
edits
1 parent ff4a806 commit 0050be0

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

source/read-write-configuration.txt

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -52,28 +52,29 @@ The ``writeConcern()`` and ``withWriteConcern()`` methods accept a
5252
``WriteConcern`` instance as a parameter. You can specify the write concern by
5353
using one of the following values:
5454

55-
- ``WriteConcern.ACKNOWLEDGED``: The write operation returns after the primary
56-
node acknowledges the write operation.
55+
- ``WriteConcern.ACKNOWLEDGED``: The write operation returns after the operation
56+
is written to memory.
5757
- ``WriteConcern.W1``: The write operation returns after only the primary node acknowledges
58-
the write operation.
58+
the write operation, without waiting for acknowledgement from secondary nodes.
5959
- ``WriteConcern.W2``: The write operation returns after the primary node and
6060
at least one secondary node acknowledge the write operation.
6161
- ``WriteConcern.W3``: The write operation returns after the primary node and
62-
at least two secondary nodes acknowledge the write operation.
62+
at least two secondary nodes acknowledge the write operation.
6363
- ``WriteConcern.MAJORITY``: The write operation returns after a majority of the
64-
replica set members acknowledge the write operation.
64+
replica set members acknowledge the write operation.
6565
- ``WriteConcern.UNACKNOWLEDGED``: The write operation returns after the primary
66-
node processes the write operation.
66+
node processes the write operation.
6767
- ``WriteConcern.JOURNALED``: The write operation returns after the primary node
68-
writes the data to the on-disk journal.
68+
writes the data to the on-disk journal.
6969

70-
The following example sets the write concern to ``"majority"`` for on a client
71-
instance:
70+
The following example sets the write concern to ``"majority"`` for an instance of
71+
``MongoClient``:
7272

7373
.. literalinclude:: /includes/read-write-configuration.java
7474
:start-after: // start-write-concern-client
7575
:end-before: // end-write-concern-client
7676
:language: java
77+
:emphasize-lines: 3
7778

7879
The following example sets the write concern to ``"majority"`` for a collection:
7980

@@ -109,7 +110,7 @@ methods accept a single parameter that specifies the read concern level.
109110
You can set the following read concern levels:
110111

111112
- ``ReadConcern.LOCAL``: The query returns the instance's most recent data. Provides no guarantee
112-
that the data has been written to a majority of the replica set members.
113+
that the data has been written to a majority of the replica set members.
113114
- ``ReadConern.AVAILABLE``: The query returns the instance's most recent data.
114115
Provides no guarantee that the data has been written to a majority of the
115116
replica set members. ``ReadConcern.AVAILABLE`` is not available for use with
@@ -120,7 +121,7 @@ You can set the following read concern levels:
120121
successful writes that completed prior to the start of the read operation.
121122
``ReadConcern.LINEARIZABLE`` is not available for use with causally consistent
122123
sessions and transactions.
123-
- ``ReadConcern.SNAPSHOT``: The query returns majority-committed data as it appears across shards from a
124+
- ``ReadConcern.SNAPSHOT``: The query returns majority-committed data as it appears across shards, from a
124125
specific single point in the recent past.
125126

126127
For more information about the read concern levels, see :manual:`Read Concern
@@ -134,6 +135,7 @@ The following example sets the read concern to ``ReadConcern.MAJORITY`` for an i
134135
:start-after: // start-read-concern-client
135136
:end-before: // end-read-concern-client
136137
:language: java
138+
:emphasize-lines: 3
137139

138140
The following example sets the read concern to ``ReadConcern.MAJORITY`` for a
139141
collection:
@@ -150,8 +152,7 @@ Read Preference
150152
---------------
151153

152154
Read preference determines which member of a replica set MongoDB reads when
153-
running a query. You can also customize how the server evaluates a replica set
154-
member. You can set the read preference by using the ``readPreference()`` method
155+
running a query. You can set the read preference by using the ``readPreference()`` method
155156
on a client or transaction, or by using the ``withReadPreference()``
156157
method on a database or collection.
157158

@@ -175,6 +176,7 @@ for an instance of ``MongoClient``:
175176
:start-after: // start-read-preference-client
176177
:end-before: // end-read-preference-client
177178
:language: java
179+
:emphasize-lines: 3
178180

179181
The following example sets the read preference to ``ReadPreference.secondary()``
180182
for a collection:

0 commit comments

Comments
 (0)