summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_single_document_transformation.h
diff options
context:
space:
mode:
authorNick Zolnierz <nicholas.zolnierz@mongodb.com>2018-04-03 17:00:41 -0400
committerNick Zolnierz <nicholas.zolnierz@mongodb.com>2018-04-11 15:53:03 -0400
commitfff261ac550155065fce4b7b1529061f18980599 (patch)
tree09ce022d7b8319f1af3c2db2354427ecfe1aa389 /src/mongo/db/pipeline/document_source_single_document_transformation.h
parent0fa7bcb8bea5d4585fdbc1003b5116cd7bf28540 (diff)
downloadmongo-fff261ac550155065fce4b7b1529061f18980599.tar.gz
SERVER-29134: Support change streams on an entire database in a sharded cluster
Diffstat (limited to 'src/mongo/db/pipeline/document_source_single_document_transformation.h')
-rw-r--r--src/mongo/db/pipeline/document_source_single_document_transformation.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/mongo/db/pipeline/document_source_single_document_transformation.h b/src/mongo/db/pipeline/document_source_single_document_transformation.h
index bffa484c46b..5d0e850d3fd 100644
--- a/src/mongo/db/pipeline/document_source_single_document_transformation.h
+++ b/src/mongo/db/pipeline/document_source_single_document_transformation.h
@@ -94,7 +94,8 @@ public:
DocumentSourceSingleDocumentTransformation(
const boost::intrusive_ptr<ExpressionContext>& pExpCtx,
std::unique_ptr<TransformerInterface> parsedTransform,
- std::string name);
+ std::string name,
+ bool independentOfAnyCollection);
// virtuals from DocumentSource
const char* getSourceName() const final;
@@ -122,6 +123,9 @@ public:
constraints.canSwapWithMatch = true;
constraints.canSwapWithLimit = true;
+ // This transformation could be part of a 'collectionless' change stream on an entire
+ // database or cluster, mark as independent of any collection if so.
+ constraints.isIndependentOfAnyCollection = _isIndependentOfAnyCollection;
return constraints;
}
@@ -146,6 +150,9 @@ private:
// Specific name of the transformation.
std::string _name;
+ // Set to true if this transformation stage can be run on the collectionless namespace.
+ bool _isIndependentOfAnyCollection;
+
// Cached stage options in case this DocumentSource is disposed before serialized (e.g. explain
// with a sort which will auto-dispose of the pipeline).
Document _cachedStageOptions;