Skip to content

Commit d101a58

Browse files
committed
PHPLIB-408: Update Transactions Retry Example 3 to include read preference
1 parent b86fae4 commit d101a58

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/DocumentationExamplesTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1356,7 +1356,8 @@ private function updateEmployeeInfo3(\MongoDB\Client $client, \MongoDB\Driver\Se
13561356
{
13571357
$session->startTransaction([
13581358
'readConcern' => new \MongoDB\Driver\ReadConcern("snapshot"),
1359-
'writeConcern' => new \MongoDB\Driver\WriteConcern(\MongoDB\Driver\WriteConcern::MAJORITY)
1359+
'readPrefernece' => new \MongoDB\Driver\ReadPreference(\MongoDB\Driver\ReadPreference::RP_PRIMARY),
1360+
'writeConcern' => new \MongoDB\Driver\WriteConcern(\MongoDB\Driver\WriteConcern::MAJORITY),
13601361
]);
13611362

13621363
try {

0 commit comments

Comments
 (0)