From 886cf657bbf1200dae7e4a656aa06523dbd0b2d2 Mon Sep 17 00:00:00 2001 From: Prashant Mital Date: Tue, 16 Jul 2019 18:20:18 -0700 Subject: [PATCH] PYTHON-1905 Don't send fullDocument field by default with every $changeStream pipeline stage --- pymongo/collection.py | 5 +- pymongo/database.py | 5 +- pymongo/mongo_client.py | 5 +- .../change_streams/change-streams-errors.json | 4 +- test/change_streams/change-streams.json | 33 ++---- .../aggregate-serverErrors.json | 2 +- ...angeStreams-client.watch-serverErrors.json | 27 +---- .../changeStreams-client.watch.json | 6 -- ...ngeStreams-db.coll.watch-serverErrors.json | 102 +++++------------- .../changeStreams-db.coll.watch.json | 24 ++--- .../changeStreams-db.watch-serverErrors.json | 102 +++++------------- .../changeStreams-db.watch.json | 24 ++--- test/retryable_reads/count-serverErrors.json | 2 +- .../countDocuments-serverErrors.json | 2 +- .../distinct-serverErrors.json | 2 +- .../estimatedDocumentCount-serverErrors.json | 2 +- test/retryable_reads/find-serverErrors.json | 2 +- .../retryable_reads/findOne-serverErrors.json | 2 +- .../gridfs-download-serverErrors.json | 2 +- .../gridfs-downloadByName-serverErrors.json | 2 +- .../listCollectionNames-serverErrors.json | 2 +- .../listCollectionObjects-serverErrors.json | 2 +- .../listCollections-serverErrors.json | 2 +- .../listDatabaseNames-serverErrors.json | 2 +- .../listDatabaseObjects-serverErrors.json | 2 +- .../listDatabases-serverErrors.json | 2 +- .../listIndexNames-serverErrors.json | 2 +- .../listIndexes-serverErrors.json | 2 +- test/test_change_stream.py | 2 +- 29 files changed, 98 insertions(+), 275 deletions(-) diff --git a/pymongo/collection.py b/pymongo/collection.py index d47a43ae8..29776a7e2 100644 --- a/pymongo/collection.py +++ b/pymongo/collection.py @@ -2405,7 +2405,7 @@ class Collection(common.BaseObject): explicit_session=False, **kwargs) - def watch(self, pipeline=None, full_document='default', resume_after=None, + def watch(self, pipeline=None, full_document=None, resume_after=None, max_await_time_ms=None, batch_size=None, collation=None, start_at_operation_time=None, session=None, start_after=None): """Watch changes on this collection. @@ -2462,8 +2462,7 @@ class Collection(common.BaseObject): pipeline stages are valid after a ``$changeStream`` stage, see the MongoDB documentation on change streams for the supported stages. - `full_document` (optional): The fullDocument to pass as an option - to the ``$changeStream`` stage. Allowed values: 'default', - 'updateLookup'. Defaults to 'default'. + to the ``$changeStream`` stage. Allowed values: 'updateLookup'. When set to 'updateLookup', the change notification for partial updates will include both a delta describing the changes to the document, as well as a copy of the entire document that was diff --git a/pymongo/database.py b/pymongo/database.py index 9287a2cf5..52fbda81e 100644 --- a/pymongo/database.py +++ b/pymongo/database.py @@ -513,7 +513,7 @@ class Database(common.BaseObject): cmd.get_cursor, cmd.get_read_preference(s), s, retryable=not cmd._performs_write) - def watch(self, pipeline=None, full_document='default', resume_after=None, + def watch(self, pipeline=None, full_document=None, resume_after=None, max_await_time_ms=None, batch_size=None, collation=None, start_at_operation_time=None, session=None, start_after=None): """Watch changes on this database. @@ -561,8 +561,7 @@ class Database(common.BaseObject): pipeline stages are valid after a ``$changeStream`` stage, see the MongoDB documentation on change streams for the supported stages. - `full_document` (optional): The fullDocument to pass as an option - to the ``$changeStream`` stage. Allowed values: 'default', - 'updateLookup'. Defaults to 'default'. + to the ``$changeStream`` stage. Allowed values: 'updateLookup'. When set to 'updateLookup', the change notification for partial updates will include both a delta describing the changes to the document, as well as a copy of the entire document that was diff --git a/pymongo/mongo_client.py b/pymongo/mongo_client.py index 94df5c080..210ebaaa4 100644 --- a/pymongo/mongo_client.py +++ b/pymongo/mongo_client.py @@ -807,7 +807,7 @@ class MongoClient(common.BaseObject): return getattr(server.description, attr_name) - def watch(self, pipeline=None, full_document='default', resume_after=None, + def watch(self, pipeline=None, full_document=None, resume_after=None, max_await_time_ms=None, batch_size=None, collation=None, start_at_operation_time=None, session=None, start_after=None): """Watch changes on this cluster. @@ -855,8 +855,7 @@ class MongoClient(common.BaseObject): pipeline stages are valid after a ``$changeStream`` stage, see the MongoDB documentation on change streams for the supported stages. - `full_document` (optional): The fullDocument to pass as an option - to the ``$changeStream`` stage. Allowed values: 'default', - 'updateLookup'. Defaults to 'default'. + to the ``$changeStream`` stage. Allowed values: 'updateLookup'. When set to 'updateLookup', the change notification for partial updates will include both a delta describing the changes to the document, as well as a copy of the entire document that was diff --git a/test/change_streams/change-streams-errors.json b/test/change_streams/change-streams-errors.json index 7eed273fe..00f51eb47 100644 --- a/test/change_streams/change-streams-errors.json +++ b/test/change_streams/change-streams-errors.json @@ -54,9 +54,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} }, { "$unsupported": "foo" diff --git a/test/change_streams/change-streams.json b/test/change_streams/change-streams.json index 34371ced0..4aeb2c7f7 100644 --- a/test/change_streams/change-streams.json +++ b/test/change_streams/change-streams.json @@ -33,9 +33,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -153,9 +151,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -226,9 +222,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} }, { "$match": { @@ -312,9 +306,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -404,7 +396,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -523,9 +514,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -611,9 +600,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -665,9 +652,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -756,9 +741,7 @@ }, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, diff --git a/test/retryable_reads/aggregate-serverErrors.json b/test/retryable_reads/aggregate-serverErrors.json index 211c31861..04208bc95 100644 --- a/test/retryable_reads/aggregate-serverErrors.json +++ b/test/retryable_reads/aggregate-serverErrors.json @@ -125,7 +125,7 @@ ] }, { - "description": "Aggregate succeeds after InterruptedDueToStepDown", + "description": "Aggregate succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/retryable_reads/changeStreams-client.watch-serverErrors.json b/test/retryable_reads/changeStreams-client.watch-serverErrors.json index f70ba9dc1..cf6c230ec 100644 --- a/test/retryable_reads/changeStreams-client.watch-serverErrors.json +++ b/test/retryable_reads/changeStreams-client.watch-serverErrors.json @@ -59,7 +59,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -76,7 +75,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -88,7 +86,7 @@ ] }, { - "description": "client.watch succeeds after InterruptedDueToStepDown", + "description": "client.watch succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { @@ -116,7 +114,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -133,7 +130,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -173,7 +169,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -190,7 +185,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -230,7 +224,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -247,7 +240,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -287,7 +279,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -304,7 +295,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -344,7 +334,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -361,7 +350,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -401,7 +389,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -418,7 +405,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -458,7 +444,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -475,7 +460,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -515,7 +499,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -532,7 +515,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -572,7 +554,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -589,7 +570,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -629,7 +609,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -646,7 +625,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -687,7 +665,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -704,7 +681,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -748,7 +724,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } diff --git a/test/retryable_reads/changeStreams-client.watch.json b/test/retryable_reads/changeStreams-client.watch.json index bfb58a70e..9a2ccad09 100644 --- a/test/retryable_reads/changeStreams-client.watch.json +++ b/test/retryable_reads/changeStreams-client.watch.json @@ -39,7 +39,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -79,7 +78,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -96,7 +94,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -140,7 +137,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -181,7 +177,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } @@ -198,7 +193,6 @@ "pipeline": [ { "$changeStream": { - "fullDocument": "default", "allChangesForCluster": true } } diff --git a/test/retryable_reads/changeStreams-db.coll.watch-serverErrors.json b/test/retryable_reads/changeStreams-db.coll.watch-serverErrors.json index a612b496b..eb7df1e26 100644 --- a/test/retryable_reads/changeStreams-db.coll.watch-serverErrors.json +++ b/test/retryable_reads/changeStreams-db.coll.watch-serverErrors.json @@ -58,9 +58,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -74,9 +72,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -86,7 +82,7 @@ ] }, { - "description": "db.coll.watch succeeds after InterruptedDueToStepDown", + "description": "db.coll.watch succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { @@ -113,9 +109,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -129,9 +123,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -168,9 +160,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -184,9 +174,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -223,9 +211,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -239,9 +225,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -278,9 +262,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -294,9 +276,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -333,9 +313,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -349,9 +327,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -388,9 +364,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -404,9 +378,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -443,9 +415,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -459,9 +429,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -498,9 +466,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -514,9 +480,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -553,9 +517,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -569,9 +531,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -608,9 +568,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -624,9 +582,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -664,9 +620,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -680,9 +634,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -723,9 +675,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, diff --git a/test/retryable_reads/changeStreams-db.coll.watch.json b/test/retryable_reads/changeStreams-db.coll.watch.json index 67d56b2cd..3408c8423 100644 --- a/test/retryable_reads/changeStreams-db.coll.watch.json +++ b/test/retryable_reads/changeStreams-db.coll.watch.json @@ -38,9 +38,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -77,9 +75,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -93,9 +89,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -136,9 +130,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -176,9 +168,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -192,9 +182,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, diff --git a/test/retryable_reads/changeStreams-db.watch-serverErrors.json b/test/retryable_reads/changeStreams-db.watch-serverErrors.json index 3f77c501f..e070f56a0 100644 --- a/test/retryable_reads/changeStreams-db.watch-serverErrors.json +++ b/test/retryable_reads/changeStreams-db.watch-serverErrors.json @@ -58,9 +58,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -74,9 +72,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -86,7 +82,7 @@ ] }, { - "description": "db.watch succeeds after InterruptedDueToStepDown", + "description": "db.watch succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { @@ -113,9 +109,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -129,9 +123,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -168,9 +160,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -184,9 +174,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -223,9 +211,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -239,9 +225,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -278,9 +262,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -294,9 +276,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -333,9 +313,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -349,9 +327,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -388,9 +364,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -404,9 +378,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -443,9 +415,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -459,9 +429,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -498,9 +466,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -514,9 +480,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -553,9 +517,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -569,9 +531,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -608,9 +568,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -624,9 +582,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -664,9 +620,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -680,9 +634,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -723,9 +675,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, diff --git a/test/retryable_reads/changeStreams-db.watch.json b/test/retryable_reads/changeStreams-db.watch.json index 8f1099bc7..bec09c49b 100644 --- a/test/retryable_reads/changeStreams-db.watch.json +++ b/test/retryable_reads/changeStreams-db.watch.json @@ -38,9 +38,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -77,9 +75,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -93,9 +89,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -136,9 +130,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -176,9 +168,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, @@ -192,9 +182,7 @@ "cursor": {}, "pipeline": [ { - "$changeStream": { - "fullDocument": "default" - } + "$changeStream": {} } ] }, diff --git a/test/retryable_reads/count-serverErrors.json b/test/retryable_reads/count-serverErrors.json index b13bb893d..839680fe5 100644 --- a/test/retryable_reads/count-serverErrors.json +++ b/test/retryable_reads/count-serverErrors.json @@ -71,7 +71,7 @@ ] }, { - "description": "Count succeeds after InterruptedDueToStepDown", + "description": "Count succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/retryable_reads/countDocuments-serverErrors.json b/test/retryable_reads/countDocuments-serverErrors.json index 641fdc908..f45eadfa0 100644 --- a/test/retryable_reads/countDocuments-serverErrors.json +++ b/test/retryable_reads/countDocuments-serverErrors.json @@ -97,7 +97,7 @@ ] }, { - "description": "CountDocuments succeeds after InterruptedDueToStepDown", + "description": "CountDocuments succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/retryable_reads/distinct-serverErrors.json b/test/retryable_reads/distinct-serverErrors.json index 533a38c94..50fd6a550 100644 --- a/test/retryable_reads/distinct-serverErrors.json +++ b/test/retryable_reads/distinct-serverErrors.json @@ -95,7 +95,7 @@ ] }, { - "description": "Distinct succeeds after InterruptedDueToStepDown", + "description": "Distinct succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/retryable_reads/estimatedDocumentCount-serverErrors.json b/test/retryable_reads/estimatedDocumentCount-serverErrors.json index fd94d2183..1af21d1fe 100644 --- a/test/retryable_reads/estimatedDocumentCount-serverErrors.json +++ b/test/retryable_reads/estimatedDocumentCount-serverErrors.json @@ -68,7 +68,7 @@ ] }, { - "description": "EstimatedDocumentCount succeeds after InterruptedDueToStepDown", + "description": "EstimatedDocumentCount succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/retryable_reads/find-serverErrors.json b/test/retryable_reads/find-serverErrors.json index e7d49f6ea..44ecf34d2 100644 --- a/test/retryable_reads/find-serverErrors.json +++ b/test/retryable_reads/find-serverErrors.json @@ -114,7 +114,7 @@ ] }, { - "description": "Find succeeds after InterruptedDueToStepDown", + "description": "Find succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/retryable_reads/findOne-serverErrors.json b/test/retryable_reads/findOne-serverErrors.json index 7c235ef32..b8229483d 100644 --- a/test/retryable_reads/findOne-serverErrors.json +++ b/test/retryable_reads/findOne-serverErrors.json @@ -94,7 +94,7 @@ ] }, { - "description": "FindOne succeeds after InterruptedDueToStepDown", + "description": "FindOne succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/retryable_reads/gridfs-download-serverErrors.json b/test/retryable_reads/gridfs-download-serverErrors.json index ae1c3c691..84e50e370 100644 --- a/test/retryable_reads/gridfs-download-serverErrors.json +++ b/test/retryable_reads/gridfs-download-serverErrors.json @@ -121,7 +121,7 @@ ] }, { - "description": "Download succeeds after InterruptedDueToStepDown", + "description": "Download succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/retryable_reads/gridfs-downloadByName-serverErrors.json b/test/retryable_reads/gridfs-downloadByName-serverErrors.json index 4e2441e74..de439ce4b 100644 --- a/test/retryable_reads/gridfs-downloadByName-serverErrors.json +++ b/test/retryable_reads/gridfs-downloadByName-serverErrors.json @@ -115,7 +115,7 @@ ] }, { - "description": "DownloadByName succeeds after InterruptedDueToStepDown", + "description": "DownloadByName succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/retryable_reads/listCollectionNames-serverErrors.json b/test/retryable_reads/listCollectionNames-serverErrors.json index 48a5db5ef..27c13d630 100644 --- a/test/retryable_reads/listCollectionNames-serverErrors.json +++ b/test/retryable_reads/listCollectionNames-serverErrors.json @@ -56,7 +56,7 @@ ] }, { - "description": "ListCollectionNames succeeds after InterruptedDueToStepDown", + "description": "ListCollectionNames succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/retryable_reads/listCollectionObjects-serverErrors.json b/test/retryable_reads/listCollectionObjects-serverErrors.json index 8ce6a27c5..3922713df 100644 --- a/test/retryable_reads/listCollectionObjects-serverErrors.json +++ b/test/retryable_reads/listCollectionObjects-serverErrors.json @@ -56,7 +56,7 @@ ] }, { - "description": "ListCollectionObjects succeeds after InterruptedDueToStepDown", + "description": "ListCollectionObjects succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/retryable_reads/listCollections-serverErrors.json b/test/retryable_reads/listCollections-serverErrors.json index a2abf4acf..6972073b1 100644 --- a/test/retryable_reads/listCollections-serverErrors.json +++ b/test/retryable_reads/listCollections-serverErrors.json @@ -56,7 +56,7 @@ ] }, { - "description": "ListCollections succeeds after InterruptedDueToStepDown", + "description": "ListCollections succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/retryable_reads/listDatabaseNames-serverErrors.json b/test/retryable_reads/listDatabaseNames-serverErrors.json index 6e6adb77c..11faf58bf 100644 --- a/test/retryable_reads/listDatabaseNames-serverErrors.json +++ b/test/retryable_reads/listDatabaseNames-serverErrors.json @@ -56,7 +56,7 @@ ] }, { - "description": "ListDatabaseNames succeeds after InterruptedDueToStepDown", + "description": "ListDatabaseNames succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/retryable_reads/listDatabaseObjects-serverErrors.json b/test/retryable_reads/listDatabaseObjects-serverErrors.json index c9a95fe64..38082f2e2 100644 --- a/test/retryable_reads/listDatabaseObjects-serverErrors.json +++ b/test/retryable_reads/listDatabaseObjects-serverErrors.json @@ -56,7 +56,7 @@ ] }, { - "description": "ListDatabaseObjects succeeds after InterruptedDueToStepDown", + "description": "ListDatabaseObjects succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/retryable_reads/listDatabases-serverErrors.json b/test/retryable_reads/listDatabases-serverErrors.json index 8e18a508e..4047f749f 100644 --- a/test/retryable_reads/listDatabases-serverErrors.json +++ b/test/retryable_reads/listDatabases-serverErrors.json @@ -56,7 +56,7 @@ ] }, { - "description": "ListDatabases succeeds after InterruptedDueToStepDown", + "description": "ListDatabases succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/retryable_reads/listIndexNames-serverErrors.json b/test/retryable_reads/listIndexNames-serverErrors.json index 6b8b55d08..1a9ba83bc 100644 --- a/test/retryable_reads/listIndexNames-serverErrors.json +++ b/test/retryable_reads/listIndexNames-serverErrors.json @@ -58,7 +58,7 @@ ] }, { - "description": "ListIndexNames succeeds after InterruptedDueToStepDown", + "description": "ListIndexNames succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/retryable_reads/listIndexes-serverErrors.json b/test/retryable_reads/listIndexes-serverErrors.json index b1043310f..16b61d535 100644 --- a/test/retryable_reads/listIndexes-serverErrors.json +++ b/test/retryable_reads/listIndexes-serverErrors.json @@ -58,7 +58,7 @@ ] }, { - "description": "ListIndexes succeeds after InterruptedDueToStepDown", + "description": "ListIndexes succeeds after InterruptedDueToReplStateChange", "failPoint": { "configureFailPoint": "failCommand", "mode": { diff --git a/test/test_change_stream.py b/test/test_change_stream.py index bd9860445..8d0825f2f 100644 --- a/test/test_change_stream.py +++ b/test/test_change_stream.py @@ -349,7 +349,7 @@ class TestCollectionChangeStream(IntegrationTest, ChangeStreamTryNextMixin): command = results['started'][0] self.assertEqual('aggregate', command.command_name) self.assertEqual([ - {'$changeStream': {'fullDocument': 'default'}}, + {'$changeStream': {}}, {'$project': {'foo': 0}}], command.command['pipeline'])