PYTHON-1621 Modify change stream output example for manual (#370)

This commit is contained in:
Prashant Mital 2018-08-10 15:21:54 -07:00 committed by GitHub
parent 88ab7ed4ea
commit 9aa7adab0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -695,12 +695,8 @@ class TestSampleShellCommands(unittest.TestCase):
# Start Changestream Example 4
pipeline = [
{"$match": {
"$or": [
{"fullDocument.username": "alice"},
{"operationType": {"$in": ["delete"]}}]
}
}
{'$match': {'fullDocument.username': 'alice'}},
{'$addFields': {'newField': 'this is an added field!'}}
]
cursor = db.inventory.watch(pipeline=pipeline)
document = next(cursor)