summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/explain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/explain.cpp')
-rw-r--r--src/mongo/db/query/explain.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/db/query/explain.cpp b/src/mongo/db/query/explain.cpp
index 68ebe4f86b7..633f869e832 100644
--- a/src/mongo/db/query/explain.cpp
+++ b/src/mongo/db/query/explain.cpp
@@ -401,6 +401,20 @@ namespace mongo {
bob->append("indexPrefix", spec->indexPrefix);
bob->append("parsedTextQuery", spec->parsedTextQuery);
}
+ else if (STAGE_UPDATE == stats.stageType) {
+ UpdateStats* spec = static_cast<UpdateStats*>(stats.specific.get());
+
+ if (verbosity >= Explain::EXEC_STATS) {
+ bob->appendNumber("nMatched", spec->nMatched);
+ bob->appendNumber("nWouldModify", spec->nModified);
+ bob->appendBool("wouldInsert", spec->inserted);
+ }
+
+ if (verbosity == Explain::FULL) {
+ bob->appendBool("fastmod", spec->fastmod);
+ bob->appendBool("fastmodinsert", spec->fastmodinsert);
+ }
+ }
// We're done if there are no children.
if (stats.children.empty()) {