summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Evans <jacob.evans@10gen.com>2019-03-13 14:32:34 -0400
committerJacob Evans <jacob.evans@10gen.com>2019-03-13 16:30:28 -0400
commite3407fe85774f6b8b0a76eef1a3040321537b760 (patch)
tree4675b089bd6ea51c5466397b65e54e57f5499261
parent84916e817418b3b5627e80730effcd422c15696e (diff)
downloadmongo-e3407fe85774f6b8b0a76eef1a3040321537b760.tar.gz
SERVER-39403 Enable accessing sub-pipeline from public const context
-rw-r--r--src/mongo/db/pipeline/document_source_lookup.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/document_source_lookup.h b/src/mongo/db/pipeline/document_source_lookup.h
index aeeba4dfa0a..f53dbcee3ad 100644
--- a/src/mongo/db/pipeline/document_source_lookup.h
+++ b/src/mongo/db/pipeline/document_source_lookup.h
@@ -166,6 +166,17 @@ public:
return !static_cast<bool>(_localField);
}
+ /**
+ * Returns a non-executable pipeline which can be useful for introspection. In this pipeline,
+ * all view definitions are resolved. This pipeline is present in both the sub-pipeline version
+ * of $lookup and the simpler 'localField/foreignField' version, but because it is not tied to
+ * any document to look up it is missing variable definitions for the former type and the $match
+ * stage which will be added to enforce the join criteria for the latter.
+ */
+ const auto& getResolvedIntrospectionPipeline() const {
+ return *_resolvedIntrospectionPipeline;
+ }
+
const Variables& getVariables_forTest() {
return _variables;
}