Skip to content

Commit a7d8c02

Browse files
committed
code edits, fixes
1 parent 617bab8 commit a7d8c02

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

source/includes/read/change-streams.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
$changeStream = $collection->watch();
1414

1515
foreach ($changeStream as $event) {
16-
echo json_encode($event), PHP_EOL;
16+
echo json_encode($event) . PHP_EOL;
1717
}
1818
// end-open-change-stream
1919

@@ -31,17 +31,17 @@
3131
$changeStream = $collection->watch($pipeline);
3232

3333
foreach ($changeStream as $event) {
34-
echo json_encode($event), PHP_EOL;
34+
echo json_encode($event) . PHP_EOL;
3535
}
3636
// end-change-stream-pipeline
3737

3838
// Passes an options argument to watch() to include the post-image of updated documents
3939
// start-change-stream-post-image
40-
$options = ['fullDocument' => 'updateLookup'];
40+
$options = ['fullDocument' => MongoDB\Operation\Watch::FULL_DOCUMENT_UPDATE_LOOKUP];
4141
$changeStream = $collection->watch([], $options);
4242

4343
foreach ($changeStream as $event) {
44-
echo json_encode($event), PHP_EOL;
44+
echo json_encode($event) . PHP_EOL;
4545
}
4646
// end-change-stream-post-image
4747

source/read/change-streams.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Open a Change Stream
5050

5151
To open a change stream, call the ``watch()`` method. The instance on which you
5252
call the ``watch()`` method determines the scope of events that the change
53-
stream monitors. You can call the ``watch()`` method on the following
53+
stream monitors. You can call the ``watch()`` method on instances of the following
5454
classes:
5555

5656
- ``MongoDB\Client``: Monitor all changes in the MongoDB deployment
@@ -182,7 +182,7 @@ change, specify the ``fullDocumentBeforeChange`` or the ``fullDocument``
182182
options in an array parameter to ``watch()``.
183183

184184
The **pre-image** is the full version of a document *before* a change. To include the
185-
pre-image in the change stream event, set the ``fullDocumentBeforeChange`` field
185+
pre-image in the change stream event, set the ``fullDocumentBeforeChange`` option
186186
to one of the following values:
187187

188188
- ``MongoDB\Operation\Watch::FULL_DOCUMENT_BEFORE_CHANGE_WHEN_AVAILABLE``: The change event includes
@@ -193,7 +193,7 @@ to one of the following values:
193193
{+php-library+} raises an error.
194194

195195
The **post-image** is the full version of a document *after* a change. To include the
196-
post-image in the change stream event, set the ``fullDocument`` field to
196+
post-image in the change stream event, set the ``fullDocument`` option to
197197
one of the following values:
198198

199199
- ``MongoDB\Operation\Watch::FULL_DOCUMENT_UPDATE_LOOKUP``: The change event includes a

0 commit comments

Comments
 (0)