diff options
Diffstat (limited to 'src/mongo/s/query/cluster_aggregate.cpp')
-rw-r--r-- | src/mongo/s/query/cluster_aggregate.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/s/query/cluster_aggregate.cpp b/src/mongo/s/query/cluster_aggregate.cpp index 4b2da5f2b34..e99c6b70ad5 100644 --- a/src/mongo/s/query/cluster_aggregate.cpp +++ b/src/mongo/s/query/cluster_aggregate.cpp @@ -352,6 +352,12 @@ Status ClusterAggregate::runAggregate(OperationContext* opCtx, updateHostsTargetedMetrics(opCtx, namespaces.executionNss, cm, involvedNamespaces); // Report usage statistics for each stage in the pipeline. liteParsedPipeline.tickGlobalStageCounters(); + + // Add 'command' object to explain output. + if (expCtx->explain) { + explain_common::appendIfRoom( + request.serializeToCommandObj().toBson(), "command", result); + } } return status; } |