diff options
Diffstat (limited to 'src/mongo/db/pipeline/document_source_change_stream_unwind_transaction.cpp')
| -rw-r--r-- | src/mongo/db/pipeline/document_source_change_stream_unwind_transaction.cpp | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/src/mongo/db/pipeline/document_source_change_stream_unwind_transaction.cpp b/src/mongo/db/pipeline/document_source_change_stream_unwind_transaction.cpp index cc5711422b4..05bfcff4df7 100644 --- a/src/mongo/db/pipeline/document_source_change_stream_unwind_transaction.cpp +++ b/src/mongo/db/pipeline/document_source_change_stream_unwind_transaction.cpp @@ -127,26 +127,18 @@ StageConstraints DocumentSourceChangeStreamUnwindTransaction::constraints( } Value DocumentSourceChangeStreamUnwindTransaction::serialize( - const SerializationOptions& opts) const { - tassert(7481400, "expression has not been initialized", _expression); - - if (opts.verbosity) { - BSONObjBuilder builder; - builder.append("stage"_sd, "internalUnwindTransaction"_sd); - builder.append(DocumentSourceChangeStreamUnwindTransactionSpec::kFilterFieldName, - _expression->serialize(opts)); - - return Value(DOC(DocumentSourceChangeStream::kStageName << builder.obj())); + boost::optional<ExplainOptions::Verbosity> explain) const { + tassert(5467604, "expression has not been initialized", _expression); + + if (explain) { + return Value( + DOC(DocumentSourceChangeStream::kStageName << DOC("stage" + << "internalUnwindTransaction"_sd + << "filter" << _filter))); } - Value spec; - if (opts.literalPolicy != LiteralSerializationPolicy::kUnchanged || opts.transformIdentifiers) { - spec = Value(DOC(DocumentSourceChangeStreamUnwindTransactionSpec::kFilterFieldName - << _expression->serialize(opts))); - } else { - spec = Value(DocumentSourceChangeStreamUnwindTransactionSpec(_filter).toBSON()); - } - return Value(Document{{kStageName, spec}}); + DocumentSourceChangeStreamUnwindTransactionSpec spec(_filter); + return Value(Document{{kStageName, Value(spec.toBSON())}}); } DepsTracker::State DocumentSourceChangeStreamUnwindTransaction::getDependencies( @@ -165,7 +157,7 @@ DepsTracker::State DocumentSourceChangeStreamUnwindTransaction::getDependencies( DocumentSource::GetModPathsReturn DocumentSourceChangeStreamUnwindTransaction::getModifiedPaths() const { - return {DocumentSource::GetModPathsReturn::Type::kAllPaths, OrderedPathSet{}, {}}; + return {DocumentSource::GetModPathsReturn::Type::kAllPaths, std::set<std::string>{}, {}}; } DocumentSource::GetNextResult DocumentSourceChangeStreamUnwindTransaction::doGetNext() { |
