summaryrefslogtreecommitdiff
path: root/src/mongo/db/ops/parsed_update.cpp
diff options
context:
space:
mode:
authorNick Zolnierz <nicholas.zolnierz@mongodb.com>2019-05-15 12:48:54 -0400
committerNick Zolnierz <nicholas.zolnierz@mongodb.com>2019-05-16 10:49:20 -0400
commit87c686b32ae4e59bea88f42e4a1d6fcb90c4f146 (patch)
treefcd9bfcae914b446baf99174a412fc685faacf47 /src/mongo/db/ops/parsed_update.cpp
parent06c7e27f2e7a668d81baf02d89f422cdda205fce (diff)
downloadmongo-87c686b32ae4e59bea88f42e4a1d6fcb90c4f146.tar.gz
SERVER-41022 Remove dependency on expressions_mongod_only in parsed_update library
Diffstat (limited to 'src/mongo/db/ops/parsed_update.cpp')
-rw-r--r--src/mongo/db/ops/parsed_update.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mongo/db/ops/parsed_update.cpp b/src/mongo/db/ops/parsed_update.cpp
index 5e489071cf5..acedfc48d8a 100644
--- a/src/mongo/db/ops/parsed_update.cpp
+++ b/src/mongo/db/ops/parsed_update.cpp
@@ -31,7 +31,6 @@
#include "mongo/db/ops/parsed_update.h"
-#include "mongo/db/matcher/extensions_callback_real.h"
#include "mongo/db/ops/update_request.h"
#include "mongo/db/query/canonical_query.h"
#include "mongo/db/query/collation/collator_factory_interface.h"
@@ -40,11 +39,14 @@
namespace mongo {
-ParsedUpdate::ParsedUpdate(OperationContext* opCtx, const UpdateRequest* request)
+ParsedUpdate::ParsedUpdate(OperationContext* opCtx,
+ const UpdateRequest* request,
+ const ExtensionsCallback& extensionsCallback)
: _opCtx(opCtx),
_request(request),
_driver(new ExpressionContext(opCtx, nullptr)),
- _canonicalQuery() {}
+ _canonicalQuery(),
+ _extensionsCallback(extensionsCallback) {}
Status ParsedUpdate::parseRequest() {
// It is invalid to request that the UpdateStage return the prior or newly-updated version
@@ -95,8 +97,6 @@ Status ParsedUpdate::parseQuery() {
Status ParsedUpdate::parseQueryToCQ() {
dassert(!_canonicalQuery.get());
- const ExtensionsCallbackReal extensionsCallback(_opCtx, &_request->getNamespaceString());
-
// The projection needs to be applied after the update operation, so we do not specify a
// projection during canonicalization.
auto qr = stdx::make_unique<QueryRequest>(_request->getNamespaceString());
@@ -125,7 +125,7 @@ Status ParsedUpdate::parseQueryToCQ() {
boost::intrusive_ptr<ExpressionContext> expCtx;
auto statusWithCQ = CanonicalQuery::canonicalize(
- _opCtx, std::move(qr), std::move(expCtx), extensionsCallback, allowedMatcherFeatures);
+ _opCtx, std::move(qr), std::move(expCtx), _extensionsCallback, allowedMatcherFeatures);
if (statusWithCQ.isOK()) {
_canonicalQuery = std::move(statusWithCQ.getValue());
}