Skip to content

Commit 828304f

Browse files
committed
Add note about replica set requirements
1 parent 2d91676 commit 828304f

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

examples/changestream.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ function toJSON(object $document): string
2323
return toRelaxedExtendedJSON(fromPHP($document));
2424
}
2525

26+
// Change streams require a replica set or sharded cluster
2627
$client = new Client(getenv('MONGODB_URI') ?: 'mongodb://127.0.0.1/');
2728

2829
$collection = $client->test->coll;

examples/with_transaction.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ function toJSON(object $document): string
2121
return toRelaxedExtendedJSON(fromPHP($document));
2222
}
2323

24+
// Transactions require a replica set (MongoDB >= 4.0) or sharded cluster (MongoDB >= 4.2)
2425
$client = new Client(getenv('MONGODB_URI') ?: 'mongodb://127.0.0.1/');
2526

2627
$collection = $client->test->coll;

0 commit comments

Comments
 (0)