Skip to content

Commit eeba808

Browse files
committed
JT feedback
1 parent 4637e5e commit eeba808

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

docs/fundamentals/read-operations.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ The ``readPreference()`` method accepts the following parameters:
634634
in the MongoDB PHP extension documentation.
635635

636636
The following example queries for documents in which the value of the ``title``
637-
field is ``"Carrie"`` and sets the read preference to ``"secondaryPreferred"``.
637+
field is ``"Carrie"`` and sets the read preference to ``ReadPreference::SECONDARY_PREFERRED``.
638638
As a result, the query retrieves the results from secondary replica set
639639
members or the primary member if no secondaries are available:
640640

@@ -668,7 +668,7 @@ members or the primary member if no secondaries are available:
668668
public function show()
669669
{
670670
$movies = Movie::where('title', 'Carrie')
671-
->readPreference('secondaryPreferred')
671+
->readPreference(ReadPreference::SECONDARY_PREFERRED)
672672
->get();
673673

674674
return view('browse_movies', [

docs/includes/fundamentals/read-operations/ReadOperationsTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use App\Models\Movie;
88
use Illuminate\Support\Facades\DB;
99
use MongoDB\Laravel\Tests\TestCase;
10+
use MongoDB\Driver\ReadPreference;
1011

1112
class ReadOperationsTest extends TestCase
1213
{
@@ -175,7 +176,7 @@ public function testReadPreference(): void
175176
{
176177
// start-read-pref
177178
$movies = Movie::where('title', 'Carrie')
178-
->readPreference('secondaryPreferred')
179+
->readPreference(ReadPreference::SECONDARY_PREFERRED)
179180
->get();
180181
// end-read-pref
181182

docs/query-builder.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,8 +1044,9 @@ set members by setting a read preference.
10441044

10451045
The following example queries the ``movies`` collection for documents
10461046
in which the ``runtime`` value is greater than ``240``. The example passes a
1047-
value of ``"secondary"`` to the ``readPreference()`` method, which sends
1048-
the query to secondary replica set members:
1047+
value of ``ReadPreference::SECONDARY_PREFERRED`` to the ``readPreference()``
1048+
method, which sends the query to secondary replica set members
1049+
or the primary member if no secondaries are available:
10491050

10501051
.. literalinclude:: /includes/query-builder/QueryBuilderTest.php
10511052
:language: php

0 commit comments

Comments
 (0)