Skip to content

Commit a69541f

Browse files
committed
PHPLIB-381: Update fourth change stream example
1 parent 4db348d commit a69541f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/DocumentationExamplesTest.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,10 @@ public function testChangeStreamExample_1_4()
10041004
$this->assertMatchesDocument($expectedChange, $firstChange);
10051005

10061006
// Start Changestream Example 4
1007-
$pipeline = [['$match' => ['$or' => [['fullDocument.username' => 'alice'], ['operationType' => 'delete']]]]];
1007+
$pipeline = [
1008+
['$match' => ['fullDocument.username' => 'alice']],
1009+
['$addFields' => ['newField' => 'this is an added field!']],
1010+
];
10081011
$changeStream = $db->inventory->watch($pipeline);
10091012
$changeStream->rewind();
10101013

0 commit comments

Comments
 (0)