From 6a5e743910ad6b2d9aea53aae046b2a0b63d3198 Mon Sep 17 00:00:00 2001 From: samontea Date: Mon, 8 Feb 2021 19:00:08 +0000 Subject: SERVER-53127 Let AggregationRequestHelper::parseFromBSON() return an AggregateCommand --- src/mongo/s/commands/cluster_distinct_cmd.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/mongo/s/commands/cluster_distinct_cmd.cpp') diff --git a/src/mongo/s/commands/cluster_distinct_cmd.cpp b/src/mongo/s/commands/cluster_distinct_cmd.cpp index 7d1e5bc7c0b..7e695d526e2 100644 --- a/src/mongo/s/commands/cluster_distinct_cmd.cpp +++ b/src/mongo/s/commands/cluster_distinct_cmd.cpp @@ -138,15 +138,13 @@ public: viewAggCmd, verbosity, APIParameters::get(opCtx).getAPIStrict().value_or(false)); - if (!aggRequestOnView.isOK()) { - return aggRequestOnView.getStatus(); - } + auto bodyBuilder = result->getBodyBuilder(); // An empty PrivilegeVector is acceptable because these privileges are only checked on // getMore and explain will not open a cursor. return ClusterAggregate::retryOnViewError(opCtx, - aggRequestOnView.getValue(), + aggRequestOnView, *ex.extraInfo(), nss, PrivilegeVector(), @@ -216,9 +214,8 @@ public: viewAggCmd, boost::none, APIParameters::get(opCtx).getAPIStrict().value_or(false)); - uassertStatusOK(aggRequestOnView.getStatus()); - auto resolvedAggRequest = ex->asExpandedViewAggregation(aggRequestOnView.getValue()); + auto resolvedAggRequest = ex->asExpandedViewAggregation(aggRequestOnView); auto resolvedAggCmd = aggregation_request_helper::serializeToCommandObj(resolvedAggRequest); -- cgit v1.2.1