summaryrefslogtreecommitdiff
path: root/jstests/sharding/change_streams
diff options
context:
space:
mode:
authorRomans Kasperovics <romans.kasperovics@mongodb.com>2022-12-20 11:26:52 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-12-20 11:59:17 +0000
commit5324ef1fab3f06ad008050ac12fadb12b8de877c (patch)
tree8d275c491bf7f5f378947269dca3d3c53ad0abf8 /jstests/sharding/change_streams
parentf84b645556a27b078b61260d55c53b664aff8b7f (diff)
downloadmongo-5324ef1fab3f06ad008050ac12fadb12b8de877c.tar.gz
SERVER-70042 Assign expected / actual semantics to assert.docEq() arguments
Diffstat (limited to 'jstests/sharding/change_streams')
-rw-r--r--jstests/sharding/change_streams/lookup_change_stream_post_image_compound_shard_key.js8
-rw-r--r--jstests/sharding/change_streams/lookup_change_stream_post_image_hashed_shard_key.js2
-rw-r--r--jstests/sharding/change_streams/lookup_change_stream_post_image_id_shard_key.js4
3 files changed, 7 insertions, 7 deletions
diff --git a/jstests/sharding/change_streams/lookup_change_stream_post_image_compound_shard_key.js b/jstests/sharding/change_streams/lookup_change_stream_post_image_compound_shard_key.js
index 97fb61631f3..be654754e3c 100644
--- a/jstests/sharding/change_streams/lookup_change_stream_post_image_compound_shard_key.js
+++ b/jstests/sharding/change_streams/lookup_change_stream_post_image_compound_shard_key.js
@@ -75,8 +75,8 @@ for (let id = 0; id < nDocs; ++id) {
next = changeStream.next();
assert.eq(next.operationType, "update");
assert.eq(next.documentKey, Object.merge(shardKeyFromId(id), {_id: id}));
- assert.docEq(next.fullDocument,
- Object.merge(shardKeyFromId(id), {_id: id, updatedCount: 1}));
+ assert.docEq(Object.merge(shardKeyFromId(id), {_id: id, updatedCount: 1}),
+ next.fullDocument);
}
});
@@ -101,8 +101,8 @@ assert.commandWorked(mongosDB.adminCommand({
let next = changeStream.next();
assert.eq(next.operationType, "update");
assert.eq(next.documentKey, Object.merge(shardKeyFromId(id), {_id: id}));
- assert.docEq(next.fullDocument,
- Object.merge(shardKeyFromId(id), {_id: id, updatedCount: 2}));
+ assert.docEq(Object.merge(shardKeyFromId(id), {_id: id, updatedCount: 2}),
+ next.fullDocument);
}
});
diff --git a/jstests/sharding/change_streams/lookup_change_stream_post_image_hashed_shard_key.js b/jstests/sharding/change_streams/lookup_change_stream_post_image_hashed_shard_key.js
index bc94cfbfe6e..b6f0a12c595 100644
--- a/jstests/sharding/change_streams/lookup_change_stream_post_image_hashed_shard_key.js
+++ b/jstests/sharding/change_streams/lookup_change_stream_post_image_hashed_shard_key.js
@@ -65,7 +65,7 @@ for (let id = 0; id < nDocs; ++id) {
next = changeStream.next();
assert.eq(next.operationType, "update");
assert.eq(next.documentKey, {shardKey: id, _id: id});
- assert.docEq(next.fullDocument, {_id: id, shardKey: id, updatedCount: 1});
+ assert.docEq({_id: id, shardKey: id, updatedCount: 1}, next.fullDocument);
}
st.stop();
diff --git a/jstests/sharding/change_streams/lookup_change_stream_post_image_id_shard_key.js b/jstests/sharding/change_streams/lookup_change_stream_post_image_id_shard_key.js
index f577ff932e3..17dbac13b94 100644
--- a/jstests/sharding/change_streams/lookup_change_stream_post_image_id_shard_key.js
+++ b/jstests/sharding/change_streams/lookup_change_stream_post_image_id_shard_key.js
@@ -62,7 +62,7 @@ for (let nextId of [1000, -1000]) {
assert.eq(next.operationType, "update");
// Only the "_id" field is present in next.documentKey because the shard key is the _id.
assert.eq(next.documentKey, {_id: nextId});
- assert.docEq(next.fullDocument, {_id: nextId, updatedCount: 1});
+ assert.docEq({_id: nextId, updatedCount: 1}, next.fullDocument);
}
// Test that the change stream can still see the updated post image, even if a chunk is
@@ -81,7 +81,7 @@ for (let nextId of [1000, -1000]) {
let next = changeStream.next();
assert.eq(next.operationType, "update");
assert.eq(next.documentKey, {_id: nextId});
- assert.docEq(next.fullDocument, {_id: nextId, updatedCount: 2});
+ assert.docEq({_id: nextId, updatedCount: 2}, next.fullDocument);
}
st.stop();