summaryrefslogtreecommitdiff
path: root/jstests/noPassthrough/read_committed_lookup.js
diff options
context:
space:
mode:
Diffstat (limited to 'jstests/noPassthrough/read_committed_lookup.js')
-rw-r--r--jstests/noPassthrough/read_committed_lookup.js42
1 files changed, 19 insertions, 23 deletions
diff --git a/jstests/noPassthrough/read_committed_lookup.js b/jstests/noPassthrough/read_committed_lookup.js
index 1569f28fe25..368dfa311a1 100644
--- a/jstests/noPassthrough/read_committed_lookup.js
+++ b/jstests/noPassthrough/read_committed_lookup.js
@@ -61,7 +61,9 @@ load("jstests/replsets/rslib.js"); // For startSetIfSupportsReadMajority.
}
// Seed matching data.
- var majorityWriteConcernObj = {writeConcern: {w: "majority", wtimeout: 60*1000}};
+ var majorityWriteConcernObj = {
+ writeConcern: {w: "majority", wtimeout: 60 * 1000}
+ };
var localId = db.local.insertOne({foreignKey: "x"}, majorityWriteConcernObj).insertedId;
var foreignId = db.foreign.insertOne({matchedField: "x"}, majorityWriteConcernObj).insertedId;
@@ -71,34 +73,28 @@ load("jstests/replsets/rslib.js"); // For startSetIfSupportsReadMajority.
aggregate: "local",
pipeline: [
{
- $lookup: {
- from: "foreign",
- localField: "foreignKey",
- foreignField: "matchedField",
- as: "match",
- }
+ $lookup: {
+ from: "foreign",
+ localField: "foreignKey",
+ foreignField: "matchedField",
+ as: "match",
+ }
},
],
readConcern: {
level: "majority",
}
};
- var expectedMatchedResult = [
- {
- _id: localId,
- foreignKey: "x",
- match: [
- {_id: foreignId, matchedField: "x"},
- ],
- }
- ];
- var expectedUnmatchedResult = [
- {
- _id: localId,
- foreignKey: "x",
- match: [],
- }
- ];
+ var expectedMatchedResult = [{
+ _id: localId,
+ foreignKey: "x",
+ match: [{_id: foreignId, matchedField: "x"}, ],
+ }];
+ var expectedUnmatchedResult = [{
+ _id: localId,
+ foreignKey: "x",
+ match: [],
+ }];
var result = db.runCommand(aggCmdObj).result;
assert.eq(result, expectedMatchedResult);