summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/distinct.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/distinct.cpp')
-rw-r--r--src/mongo/db/commands/distinct.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/mongo/db/commands/distinct.cpp b/src/mongo/db/commands/distinct.cpp
index 0f619356f96..febed50512f 100644
--- a/src/mongo/db/commands/distinct.cpp
+++ b/src/mongo/db/commands/distinct.cpp
@@ -111,7 +111,7 @@ public:
help << "{ distinct : 'collection name' , key : 'a.b' , query : {} }";
}
- virtual Status explain(OperationContext* txn,
+ virtual Status explain(OperationContext* opCtx,
const std::string& dbname,
const BSONObj& cmdObj,
ExplainCommon::Verbosity verbosity,
@@ -119,8 +119,8 @@ public:
BSONObjBuilder* out) const {
const NamespaceString nss(parseNsCollectionRequired(dbname, cmdObj));
- const ExtensionsCallbackReal extensionsCallback(txn, &nss);
- auto parsedDistinct = ParsedDistinct::parse(txn, nss, cmdObj, extensionsCallback, true);
+ const ExtensionsCallbackReal extensionsCallback(opCtx, &nss);
+ auto parsedDistinct = ParsedDistinct::parse(opCtx, nss, cmdObj, extensionsCallback, true);
if (!parsedDistinct.isOK()) {
return parsedDistinct.getStatus();
}
@@ -133,7 +133,7 @@ public:
"http://dochub.mongodb.org/core/3.4-feature-compatibility.");
}
- AutoGetCollectionOrViewForRead ctx(txn, nss);
+ AutoGetCollectionOrViewForRead ctx(opCtx, nss);
Collection* collection = ctx.getCollection();
if (ctx.getView()) {
@@ -145,12 +145,12 @@ public:
}
std::string errmsg;
(void)Command::findCommand("aggregate")
- ->run(txn, dbname, viewAggregation.getValue(), 0, errmsg, *out);
+ ->run(opCtx, dbname, viewAggregation.getValue(), 0, errmsg, *out);
return Status::OK();
}
auto executor = getExecutorDistinct(
- txn, collection, nss.ns(), &parsedDistinct.getValue(), PlanExecutor::YIELD_AUTO);
+ opCtx, collection, nss.ns(), &parsedDistinct.getValue(), PlanExecutor::YIELD_AUTO);
if (!executor.isOK()) {
return executor.getStatus();
}
@@ -159,7 +159,7 @@ public:
return Status::OK();
}
- bool run(OperationContext* txn,
+ bool run(OperationContext* opCtx,
const string& dbname,
BSONObj& cmdObj,
int options,
@@ -167,8 +167,8 @@ public:
BSONObjBuilder& result) {
const NamespaceString nss(parseNsCollectionRequired(dbname, cmdObj));
- const ExtensionsCallbackReal extensionsCallback(txn, &nss);
- auto parsedDistinct = ParsedDistinct::parse(txn, nss, cmdObj, extensionsCallback, false);
+ const ExtensionsCallbackReal extensionsCallback(opCtx, &nss);
+ auto parsedDistinct = ParsedDistinct::parse(opCtx, nss, cmdObj, extensionsCallback, false);
if (!parsedDistinct.isOK()) {
return appendCommandStatus(result, parsedDistinct.getStatus());
}
@@ -183,7 +183,7 @@ public:
"http://dochub.mongodb.org/core/3.4-feature-compatibility."));
}
- AutoGetCollectionOrViewForRead ctx(txn, nss);
+ AutoGetCollectionOrViewForRead ctx(opCtx, nss);
Collection* collection = ctx.getCollection();
if (ctx.getView()) {
@@ -196,7 +196,7 @@ public:
BSONObjBuilder aggResult;
(void)Command::findCommand("aggregate")
- ->run(txn, dbname, viewAggregation.getValue(), options, errmsg, aggResult);
+ ->run(opCtx, dbname, viewAggregation.getValue(), options, errmsg, aggResult);
if (ResolvedView::isResolvedViewErrorResponse(aggResult.asTempObj())) {
result.appendElements(aggResult.obj());
@@ -212,14 +212,14 @@ public:
}
auto executor = getExecutorDistinct(
- txn, collection, nss.ns(), &parsedDistinct.getValue(), PlanExecutor::YIELD_AUTO);
+ opCtx, collection, nss.ns(), &parsedDistinct.getValue(), PlanExecutor::YIELD_AUTO);
if (!executor.isOK()) {
return appendCommandStatus(result, executor.getStatus());
}
{
- stdx::lock_guard<Client> lk(*txn->getClient());
- CurOp::get(txn)->setPlanSummary_inlock(
+ stdx::lock_guard<Client> lk(*opCtx->getClient());
+ CurOp::get(opCtx)->setPlanSummary_inlock(
Explain::getPlanSummary(executor.getValue().get()));
}
@@ -274,13 +274,13 @@ public:
}
- auto curOp = CurOp::get(txn);
+ auto curOp = CurOp::get(opCtx);
// Get summary information about the plan.
PlanSummaryStats stats;
Explain::getSummaryStats(*executor.getValue(), &stats);
if (collection) {
- collection->infoCache()->notifyOfQuery(txn, stats.indexesUsed);
+ collection->infoCache()->notifyOfQuery(opCtx, stats.indexesUsed);
}
curOp->debug().setPlanSummaryMetrics(stats);