summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_plan_cache_stats.cpp
diff options
context:
space:
mode:
authorLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-18 17:02:53 -0300
committerLucas de Castro Borges <lucas@gnuabordo.com.br>2025-02-18 17:02:53 -0300
commit959575a5ca598bf5f37fb5cebe7ed1d80d3d71f7 (patch)
treeacc8d60aedb12b70048e676e8a7349deb0010db8 /src/mongo/db/pipeline/document_source_plan_cache_stats.cpp
parent76588293975fc059cf076779e4283e6ffaf8afff (diff)
New upstream version 6.0.20upstream
Diffstat (limited to 'src/mongo/db/pipeline/document_source_plan_cache_stats.cpp')
-rw-r--r--src/mongo/db/pipeline/document_source_plan_cache_stats.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/mongo/db/pipeline/document_source_plan_cache_stats.cpp b/src/mongo/db/pipeline/document_source_plan_cache_stats.cpp
index 51f7bf3d650..f49a3cba01f 100644
--- a/src/mongo/db/pipeline/document_source_plan_cache_stats.cpp
+++ b/src/mongo/db/pipeline/document_source_plan_cache_stats.cpp
@@ -57,9 +57,13 @@ DocumentSourcePlanCacheStats::DocumentSourcePlanCacheStats(
const boost::intrusive_ptr<ExpressionContext>& expCtx)
: DocumentSource(kStageName, expCtx) {}
-void DocumentSourcePlanCacheStats::serializeToArray(
- std::vector<Value>& array, boost::optional<ExplainOptions::Verbosity> explain) const {
- if (explain) {
+void DocumentSourcePlanCacheStats::serializeToArray(std::vector<Value>& array,
+ const SerializationOptions& opts) const {
+ if (opts.verbosity) {
+ tassert(7513100,
+ "$planCacheStats is not equipped to serialize in explain mode with redaction on",
+ !opts.transformIdentifiers &&
+ opts.literalPolicy == LiteralSerializationPolicy::kUnchanged);
array.push_back(Value{
Document{{kStageName,
Document{{"match"_sd,
@@ -67,7 +71,7 @@ void DocumentSourcePlanCacheStats::serializeToArray(
} else {
array.push_back(Value{Document{{kStageName, Document{}}}});
if (_absorbedMatch) {
- _absorbedMatch->serializeToArray(array);
+ _absorbedMatch->serializeToArray(array, opts);
}
}
}