Skip to content

Commit e91a587

Browse files
committed
JM feedback 2
1 parent 6ff3578 commit e91a587

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

source/databases-collections.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,10 +264,13 @@ pass them as a parameter to your ``MongoDB\Driver\ReadPreference`` class
264264
constructor. Then, set the ``MongoDB\Driver\ReadPreference`` object as
265265
the value of the ``readPreference`` database option.
266266

267-
The following code example sets the ``readPreference`` option to a tag set
268-
that instructs ``test_database`` to prefer reads from the New York data
269-
center (``'dc' => 'ny'``) and to fall back to the San Francisco data
270-
center (``'dc' => 'sf'``):
267+
This code example sets the ``readPreference`` option to a tag set
268+
that instructs ``test_database`` to prefer reads from secondary replica set
269+
members in the following order:
270+
271+
1. Members from the New York data center (``['dc' => 'ny']``)
272+
#. Members from the San Francisco data center (``['dc' => 'sf']``)
273+
#. Any secondary members (``[]``)
271274

272275
.. literalinclude:: /includes/databases-collections/databases-collections.php
273276
:language: php

source/includes/databases-collections/databases-collections.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@
7373
// end-collection-settings
7474

7575
// Instructs the library to prefer reads from secondary replica set members
76-
// located in New York but fall back to those in San Francisco
76+
// located in New York, followed by a secondary in San Francisco, and
77+
// lastly fall back to any secondary.
7778
// start-tag-set
7879
$readPreference = new ReadPreference(
7980
ReadPreference::RP_SECONDARY,

0 commit comments

Comments
 (0)