summaryrefslogtreecommitdiff
path: root/jstests/change_streams/whole_db_resumability.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/change_streams/whole_db_resumability.js')
-rw-r--r--jstests/change_streams/whole_db_resumability.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/jstests/change_streams/whole_db_resumability.js b/jstests/change_streams/whole_db_resumability.js
index 2e2c0e183ec..ab049e1deeb 100644
--- a/jstests/change_streams/whole_db_resumability.js
+++ b/jstests/change_streams/whole_db_resumability.js
@@ -21,7 +21,7 @@ let resumeCursor = cst.startWatchingChanges({pipeline: [{$changeStream: {}}], co
assert.commandWorked(coll.insert({_id: 1}));
assert.commandWorked(otherColl.insert({_id: 2}));
const firstInsertChangeDoc = cst.getOneChange(resumeCursor);
-assert.docEq(firstInsertChangeDoc.fullDocument, {_id: 1});
+assert.docEq({_id: 1}, firstInsertChangeDoc.fullDocument);
assert.eq(firstInsertChangeDoc.ns, {db: testDB.getName(), coll: coll.getName()});
// Test resuming the change stream after the first insert should pick up the insert on the
@@ -33,13 +33,13 @@ resumeCursor = cst.startWatchingChanges({
});
const secondInsertChangeDoc = cst.getOneChange(resumeCursor);
-assert.docEq(secondInsertChangeDoc.fullDocument, {_id: 2});
+assert.docEq({_id: 2}, secondInsertChangeDoc.fullDocument);
assert.eq(secondInsertChangeDoc.ns, {db: testDB.getName(), coll: otherColl.getName()});
// Insert a third document to the first collection and test that the change stream picks it up.
assert.commandWorked(coll.insert({_id: 3}));
const thirdInsertChangeDoc = cst.getOneChange(resumeCursor);
-assert.docEq(thirdInsertChangeDoc.fullDocument, {_id: 3});
+assert.docEq({_id: 3}, thirdInsertChangeDoc.fullDocument);
assert.eq(thirdInsertChangeDoc.ns, {db: testDB.getName(), coll: coll.getName()});
// Test resuming after the first insert again.
@@ -48,8 +48,8 @@ resumeCursor = cst.startWatchingChanges({
collection: 1,
aggregateOptions: {cursor: {batchSize: 0}},
});
-assert.docEq(cst.getOneChange(resumeCursor), secondInsertChangeDoc);
-assert.docEq(cst.getOneChange(resumeCursor), thirdInsertChangeDoc);
+assert.docEq(secondInsertChangeDoc, cst.getOneChange(resumeCursor));
+assert.docEq(thirdInsertChangeDoc, cst.getOneChange(resumeCursor));
// Test resume after second insert.
resumeCursor = cst.startWatchingChanges({
@@ -57,7 +57,7 @@ resumeCursor = cst.startWatchingChanges({
collection: 1,
aggregateOptions: {cursor: {batchSize: 0}},
});
-assert.docEq(cst.getOneChange(resumeCursor), thirdInsertChangeDoc);
+assert.docEq(thirdInsertChangeDoc, cst.getOneChange(resumeCursor));
// Rename the collection and attempt to resume from the 'rename' notification. Skip this
// test when running on a sharded collection, since these cannot be renamed.