Commit db844127 authored by Jeremy Mikola's avatar Jeremy Mikola

PHPLIB-381: Update fourth change stream example

parent 7d5b7849
...@@ -1004,7 +1004,10 @@ class DocumentationExamplesTest extends FunctionalTestCase ...@@ -1004,7 +1004,10 @@ class DocumentationExamplesTest extends FunctionalTestCase
$this->assertMatchesDocument($expectedChange, $firstChange); $this->assertMatchesDocument($expectedChange, $firstChange);
// Start Changestream Example 4 // Start Changestream Example 4
$pipeline = [['$match' => ['$or' => [['fullDocument.username' => 'alice'], ['operationType' => 'delete']]]]]; $pipeline = [
['$match' => ['fullDocument.username' => 'alice']],
['$addFields' => ['newField' => 'this is an added field!']],
];
$changeStream = $db->inventory->watch($pipeline); $changeStream = $db->inventory->watch($pipeline);
$changeStream->rewind(); $changeStream->rewind();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment