summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/pipeline/document_source_lookup.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/document_source_lookup.cpp b/src/mongo/db/pipeline/document_source_lookup.cpp
index 07ba3e97b7d..83708c8756c 100644
--- a/src/mongo/db/pipeline/document_source_lookup.cpp
+++ b/src/mongo/db/pipeline/document_source_lookup.cpp
@@ -116,7 +116,13 @@ BSONObj DocumentSourceLookUp::queryForInput(const Document& input) const {
if (localFieldVal.missing()) {
localFieldVal = Value(BSONNULL);
}
- return BSON(_foreignFieldFieldName << localFieldVal);
+
+ // { _foreignFieldFiedlName : { "$eq" : localFieldValue } }
+ BSONObjBuilder query;
+ BSONObjBuilder subObj(query.subobjStart(_foreignFieldFieldName));
+ subObj << "$eq" << localFieldVal;
+ subObj.doneFast();
+ return query.obj();
}
boost::optional<Document> DocumentSourceLookUp::unwindResult() {