diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2017-09-14 16:40:46 -0400 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2017-09-29 09:30:56 -0400 |
commit | e0a505e2a8bfe59d8bdfc4e5a25aef4861d58fcf (patch) | |
tree | 237c46d1e4fd1080ac58b890485fb6197d53484c /src/mongo/dbtests | |
parent | 026b5f6f38c883c48d063ac8ee736f7330227281 (diff) | |
download | mongo-e0a505e2a8bfe59d8bdfc4e5a25aef4861d58fcf.tar.gz |
SERVER-30731 MatchExpressionParser::parse() should require an ExpressionContext
Diffstat (limited to 'src/mongo/dbtests')
-rw-r--r-- | src/mongo/dbtests/SConscript | 1 | ||||
-rw-r--r-- | src/mongo/dbtests/documentsourcetests.cpp | 12 | ||||
-rw-r--r-- | src/mongo/dbtests/matchertests.cpp | 60 | ||||
-rw-r--r-- | src/mongo/dbtests/query_stage_collscan.cpp | 4 | ||||
-rw-r--r-- | src/mongo/dbtests/query_stage_count.cpp | 4 | ||||
-rw-r--r-- | src/mongo/dbtests/query_stage_fetch.cpp | 4 | ||||
-rw-r--r-- | src/mongo/dbtests/query_stage_multiplan.cpp | 12 | ||||
-rw-r--r-- | src/mongo/dbtests/query_stage_subplan.cpp | 12 | ||||
-rw-r--r-- | src/mongo/dbtests/query_stage_tests.cpp | 4 | ||||
-rw-r--r-- | src/mongo/dbtests/query_stage_update.cpp | 15 |
10 files changed, 73 insertions, 55 deletions
diff --git a/src/mongo/dbtests/SConscript b/src/mongo/dbtests/SConscript index ca98dec10cb..156d91111c0 100644 --- a/src/mongo/dbtests/SConscript +++ b/src/mongo/dbtests/SConscript @@ -126,6 +126,7 @@ dbtest = env.Program( "$BUILD_DIR/mongo/db/pipeline/document_value_test_util", "$BUILD_DIR/mongo/db/query/collation/collator_interface_mock", "$BUILD_DIR/mongo/db/query/query", + "$BUILD_DIR/mongo/db/query/query_planner_test_lib", "$BUILD_DIR/mongo/db/query/query_test_service_context", "$BUILD_DIR/mongo/db/repl/drop_pending_collection_reaper", "$BUILD_DIR/mongo/db/repl/repl_coordinator_global", diff --git a/src/mongo/dbtests/documentsourcetests.cpp b/src/mongo/dbtests/documentsourcetests.cpp index 9d5fc0b5162..ab3ed2b08a0 100644 --- a/src/mongo/dbtests/documentsourcetests.cpp +++ b/src/mongo/dbtests/documentsourcetests.cpp @@ -325,8 +325,7 @@ TEST_F(DocumentSourceCursorTest, TailableAwaitDataCursorStillUsableAfterTimeout) collScanParams.collection = readLock.getCollection(); collScanParams.tailable = true; auto filter = BSON("a" << 1); - auto matchExpression = - uassertStatusOK(MatchExpressionParser::parse(filter, ctx()->getCollator())); + auto matchExpression = uassertStatusOK(MatchExpressionParser::parse(filter, ctx())); auto collectionScan = stdx::make_unique<CollectionScan>( opCtx(), collScanParams, workingSet.get(), matchExpression.get()); auto queryRequest = stdx::make_unique<QueryRequest>(nss); @@ -364,8 +363,7 @@ TEST_F(DocumentSourceCursorTest, NonAwaitDataCursorShouldErrorAfterTimeout) { CollectionScanParams collScanParams; collScanParams.collection = readLock.getCollection(); auto filter = BSON("a" << 1); - auto matchExpression = - uassertStatusOK(MatchExpressionParser::parse(filter, ctx()->getCollator())); + auto matchExpression = uassertStatusOK(MatchExpressionParser::parse(filter, ctx())); auto collectionScan = stdx::make_unique<CollectionScan>( opCtx(), collScanParams, workingSet.get(), matchExpression.get()); auto queryRequest = stdx::make_unique<QueryRequest>(nss); @@ -405,8 +403,7 @@ TEST_F(DocumentSourceCursorTest, TailableAwaitDataCursorShouldErrorAfterBeingKil collScanParams.collection = readLock.getCollection(); collScanParams.tailable = true; auto filter = BSON("a" << 1); - auto matchExpression = - uassertStatusOK(MatchExpressionParser::parse(filter, ctx()->getCollator())); + auto matchExpression = uassertStatusOK(MatchExpressionParser::parse(filter, ctx())); auto collectionScan = stdx::make_unique<CollectionScan>( opCtx(), collScanParams, workingSet.get(), matchExpression.get()); auto queryRequest = stdx::make_unique<QueryRequest>(nss); @@ -444,8 +441,7 @@ TEST_F(DocumentSourceCursorTest, NormalCursorShouldErrorAfterBeingKilled) { CollectionScanParams collScanParams; collScanParams.collection = readLock.getCollection(); auto filter = BSON("a" << 1); - auto matchExpression = - uassertStatusOK(MatchExpressionParser::parse(filter, ctx()->getCollator())); + auto matchExpression = uassertStatusOK(MatchExpressionParser::parse(filter, ctx())); auto collectionScan = stdx::make_unique<CollectionScan>( opCtx(), collScanParams, workingSet.get(), matchExpression.get()); auto queryRequest = stdx::make_unique<QueryRequest>(nss); diff --git a/src/mongo/dbtests/matchertests.cpp b/src/mongo/dbtests/matchertests.cpp index 3d20d60fde3..ee02b4b24de 100644 --- a/src/mongo/dbtests/matchertests.cpp +++ b/src/mongo/dbtests/matchertests.cpp @@ -61,8 +61,8 @@ class Basic { public: void run() { BSONObj query = fromjson("{\"a\":\"b\"}"); - const CollatorInterface* collator = nullptr; - M m(query, collator); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + M m(query, expCtx); ASSERT(m.matches(fromjson("{\"a\":\"b\"}"))); } }; @@ -72,8 +72,8 @@ class DoubleEqual { public: void run() { BSONObj query = fromjson("{\"a\":5}"); - const CollatorInterface* collator = nullptr; - M m(query, collator); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + M m(query, expCtx); ASSERT(m.matches(fromjson("{\"a\":5}"))); } }; @@ -84,8 +84,8 @@ public: void run() { BSONObjBuilder query; query.append("a", 5); - const CollatorInterface* collator = nullptr; - M m(query.done(), collator); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + M m(query.done(), expCtx); ASSERT(m.matches(fromjson("{\"a\":5}"))); } }; @@ -95,8 +95,8 @@ class MixedNumericGt { public: void run() { BSONObj query = fromjson("{\"a\":{\"$gt\":4}}"); - const CollatorInterface* collator = nullptr; - M m(query, collator); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + M m(query, expCtx); BSONObjBuilder b; b.append("a", 5); ASSERT(m.matches(b.done())); @@ -111,8 +111,8 @@ public: ASSERT_EQUALS(4, query["a"].embeddedObject()["$in"].embeddedObject()["0"].number()); ASSERT_EQUALS(NumberInt, query["a"].embeddedObject()["$in"].embeddedObject()["0"].type()); - const CollatorInterface* collator = nullptr; - M m(query, collator); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + M m(query, expCtx); { BSONObjBuilder b; @@ -139,8 +139,8 @@ template <typename M> class MixedNumericEmbedded { public: void run() { - const CollatorInterface* collator = nullptr; - M m(BSON("a" << BSON("x" << 1)), collator); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + M m(BSON("a" << BSON("x" << 1)), expCtx); ASSERT(m.matches(BSON("a" << BSON("x" << 1)))); ASSERT(m.matches(BSON("a" << BSON("x" << 1.0)))); } @@ -150,8 +150,8 @@ template <typename M> class Size { public: void run() { - const CollatorInterface* collator = nullptr; - M m(fromjson("{a:{$size:4}}"), collator); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + M m(fromjson("{a:{$size:4}}"), expCtx); ASSERT(m.matches(fromjson("{a:[1,2,3,4]}"))); ASSERT(!m.matches(fromjson("{a:[1,2,3]}"))); ASSERT(!m.matches(fromjson("{a:[1,2,3,'a','b']}"))); @@ -163,8 +163,8 @@ template <typename M> class WithinBox { public: void run() { - const CollatorInterface* collator = nullptr; - M m(fromjson("{loc:{$within:{$box:[{x: 4, y:4},[6,6]]}}}"), collator); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + M m(fromjson("{loc:{$within:{$box:[{x: 4, y:4},[6,6]]}}}"), expCtx); ASSERT(!m.matches(fromjson("{loc: [3,4]}"))); ASSERT(m.matches(fromjson("{loc: [4,4]}"))); ASSERT(m.matches(fromjson("{loc: [5,5]}"))); @@ -177,8 +177,8 @@ template <typename M> class WithinPolygon { public: void run() { - const CollatorInterface* collator = nullptr; - M m(fromjson("{loc:{$within:{$polygon:[{x:0,y:0},[0,5],[5,5],[5,0]]}}}"), collator); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + M m(fromjson("{loc:{$within:{$polygon:[{x:0,y:0},[0,5],[5,5],[5,0]]}}}"), expCtx); ASSERT(m.matches(fromjson("{loc: [3,4]}"))); ASSERT(m.matches(fromjson("{loc: [4,4]}"))); ASSERT(m.matches(fromjson("{loc: {x:5,y:5}}"))); @@ -191,8 +191,8 @@ template <typename M> class WithinCenter { public: void run() { - const CollatorInterface* collator = nullptr; - M m(fromjson("{loc:{$within:{$center:[{x:30,y:30},10]}}}"), collator); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + M m(fromjson("{loc:{$within:{$center:[{x:30,y:30},10]}}}"), expCtx); ASSERT(!m.matches(fromjson("{loc: [3,4]}"))); ASSERT(m.matches(fromjson("{loc: {x:30,y:30}}"))); ASSERT(m.matches(fromjson("{loc: [20,30]}"))); @@ -208,8 +208,8 @@ template <typename M> class ElemMatchKey { public: void run() { - const CollatorInterface* collator = nullptr; - M matcher(BSON("a.b" << 1), collator); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + M matcher(BSON("a.b" << 1), expCtx); MatchDetails details; details.requestElemMatchKey(); ASSERT(!details.hasElemMatchKey()); @@ -230,10 +230,10 @@ public: AutoGetCollectionForReadCommand ctx(&opCtx, nss); const CollatorInterface* collator = nullptr; - boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + const boost::intrusive_ptr<ExpressionContext> expCtx( + new ExpressionContext(opCtxPtr.get(), collator)); M m(BSON("$where" << "function(){ return this.a == 1; }"), - collator, expCtx, ExtensionsCallbackReal(&opCtx, &nss), MatchExpressionParser::AllowedFeatures::kJavascript); @@ -246,8 +246,8 @@ template <typename M> class TimingBase { public: long dotime(const BSONObj& patt, const BSONObj& obj) { - const CollatorInterface* collator = nullptr; - M m(patt, collator); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + M m(patt, expCtx); Timer t; for (int i = 0; i < 900000; i++) { if (!m.matches(obj)) { @@ -277,10 +277,10 @@ template <typename M> class NullCollator { public: void run() { - const CollatorInterface* collator = nullptr; + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); M matcher(BSON("a" << "string"), - collator); + expCtx); ASSERT(!matcher.matches(BSON("a" << "string2"))); } @@ -292,9 +292,11 @@ class Collator { public: void run() { CollatorInterfaceMock collator(CollatorInterfaceMock::MockType::kAlwaysEqual); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + expCtx->setCollator(&collator); M matcher(BSON("a" << "string"), - &collator); + expCtx); ASSERT(matcher.matches(BSON("a" << "string2"))); } diff --git a/src/mongo/dbtests/query_stage_collscan.cpp b/src/mongo/dbtests/query_stage_collscan.cpp index d17dbdbbcfa..16d016f8eb9 100644 --- a/src/mongo/dbtests/query_stage_collscan.cpp +++ b/src/mongo/dbtests/query_stage_collscan.cpp @@ -93,8 +93,10 @@ public: // Make the filter. const CollatorInterface* collator = nullptr; + const boost::intrusive_ptr<ExpressionContext> expCtx( + new ExpressionContext(&_opCtx, collator)); StatusWithMatchExpression statusWithMatcher = - MatchExpressionParser::parse(filterObj, collator); + MatchExpressionParser::parse(filterObj, expCtx); verify(statusWithMatcher.isOK()); unique_ptr<MatchExpression> filterExpr = std::move(statusWithMatcher.getValue()); diff --git a/src/mongo/dbtests/query_stage_count.cpp b/src/mongo/dbtests/query_stage_count.cpp index 130cd6e3e4b..e28d388d0aa 100644 --- a/src/mongo/dbtests/query_stage_count.cpp +++ b/src/mongo/dbtests/query_stage_count.cpp @@ -149,8 +149,10 @@ public: unique_ptr<WorkingSet> ws(new WorkingSet); const CollatorInterface* collator = nullptr; + const boost::intrusive_ptr<ExpressionContext> expCtx( + new ExpressionContext(&_opCtx, collator)); StatusWithMatchExpression statusWithMatcher = - MatchExpressionParser::parse(request.getQuery(), collator); + MatchExpressionParser::parse(request.getQuery(), expCtx); ASSERT(statusWithMatcher.isOK()); unique_ptr<MatchExpression> expression = std::move(statusWithMatcher.getValue()); diff --git a/src/mongo/dbtests/query_stage_fetch.cpp b/src/mongo/dbtests/query_stage_fetch.cpp index e866d2df9c9..ae1dd71152e 100644 --- a/src/mongo/dbtests/query_stage_fetch.cpp +++ b/src/mongo/dbtests/query_stage_fetch.cpp @@ -194,8 +194,10 @@ public: // Make the filter. BSONObj filterObj = BSON("foo" << 6); const CollatorInterface* collator = nullptr; + const boost::intrusive_ptr<ExpressionContext> expCtx( + new ExpressionContext(&_opCtx, collator)); StatusWithMatchExpression statusWithMatcher = - MatchExpressionParser::parse(filterObj, collator); + MatchExpressionParser::parse(filterObj, expCtx); verify(statusWithMatcher.isOK()); unique_ptr<MatchExpression> filterExpr = std::move(statusWithMatcher.getValue()); diff --git a/src/mongo/dbtests/query_stage_multiplan.cpp b/src/mongo/dbtests/query_stage_multiplan.cpp index dd1fc50b924..a76b67ac9d0 100644 --- a/src/mongo/dbtests/query_stage_multiplan.cpp +++ b/src/mongo/dbtests/query_stage_multiplan.cpp @@ -164,7 +164,9 @@ TEST_F(QueryStageMultiPlanTest, MPSCollectionScanVsHighlySelectiveIXScan) { // Make the filter. BSONObj filterObj = BSON("foo" << 7); const CollatorInterface* collator = nullptr; - StatusWithMatchExpression statusWithMatcher = MatchExpressionParser::parse(filterObj, collator); + const boost::intrusive_ptr<ExpressionContext> expCtx( + new ExpressionContext(_opCtx.get(), collator)); + StatusWithMatchExpression statusWithMatcher = MatchExpressionParser::parse(filterObj, expCtx); verify(statusWithMatcher.isOK()); unique_ptr<MatchExpression> filter = std::move(statusWithMatcher.getValue()); // Make the stage. @@ -458,7 +460,9 @@ TEST_F(QueryStageMultiPlanTest, ShouldReportErrorIfExceedsTimeLimitDuringPlannin // Make the filter. BSONObj filterObj = BSON("foo" << 7); const CollatorInterface* collator = nullptr; - StatusWithMatchExpression statusWithMatcher = MatchExpressionParser::parse(filterObj, collator); + const boost::intrusive_ptr<ExpressionContext> expCtx( + new ExpressionContext(_opCtx.get(), collator)); + StatusWithMatchExpression statusWithMatcher = MatchExpressionParser::parse(filterObj, expCtx); verify(statusWithMatcher.isOK()); unique_ptr<MatchExpression> filter = std::move(statusWithMatcher.getValue()); // Make the stage. @@ -521,7 +525,9 @@ TEST_F(QueryStageMultiPlanTest, ShouldReportErrorIfKilledDuringPlanning) { // Make the filter. BSONObj filterObj = BSON("foo" << 7); const CollatorInterface* collator = nullptr; - StatusWithMatchExpression statusWithMatcher = MatchExpressionParser::parse(filterObj, collator); + const boost::intrusive_ptr<ExpressionContext> expCtx( + new ExpressionContext(_opCtx.get(), collator)); + StatusWithMatchExpression statusWithMatcher = MatchExpressionParser::parse(filterObj, expCtx); verify(statusWithMatcher.isOK()); unique_ptr<MatchExpression> filter = std::move(statusWithMatcher.getValue()); // Make the stage. diff --git a/src/mongo/dbtests/query_stage_subplan.cpp b/src/mongo/dbtests/query_stage_subplan.cpp index 3b2e474e35a..279eafac9c7 100644 --- a/src/mongo/dbtests/query_stage_subplan.cpp +++ b/src/mongo/dbtests/query_stage_subplan.cpp @@ -452,8 +452,8 @@ TEST_F(QueryStageSubplanTest, QueryStageSubplanRewriteToRootedOr) { // Rewrite (AND (OR a b) e) => (OR (AND a e) (AND b e)) { BSONObj queryObj = fromjson("{$or:[{a:1}, {b:1}], e:1}"); - const CollatorInterface* collator = nullptr; - StatusWithMatchExpression expr = MatchExpressionParser::parse(queryObj, collator); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + StatusWithMatchExpression expr = MatchExpressionParser::parse(queryObj, expCtx); ASSERT_OK(expr.getStatus()); std::unique_ptr<MatchExpression> rewrittenExpr = SubplanStage::rewriteToRootedOr(std::move(expr.getValue())); @@ -469,8 +469,8 @@ TEST_F(QueryStageSubplanTest, QueryStageSubplanRewriteToRootedOr) { // Rewrite (AND (OR a b) e f) => (OR (AND a e f) (AND b e f)) { BSONObj queryObj = fromjson("{$or:[{a:1}, {b:1}], e:1, f:1}"); - const CollatorInterface* collator = nullptr; - StatusWithMatchExpression expr = MatchExpressionParser::parse(queryObj, collator); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + StatusWithMatchExpression expr = MatchExpressionParser::parse(queryObj, expCtx); ASSERT_OK(expr.getStatus()); std::unique_ptr<MatchExpression> rewrittenExpr = SubplanStage::rewriteToRootedOr(std::move(expr.getValue())); @@ -486,8 +486,8 @@ TEST_F(QueryStageSubplanTest, QueryStageSubplanRewriteToRootedOr) { // Rewrite (AND (OR (AND a b) (AND c d) e f) => (OR (AND a b e f) (AND c d e f)) { BSONObj queryObj = fromjson("{$or:[{a:1,b:1}, {c:1,d:1}], e:1,f:1}"); - const CollatorInterface* collator = nullptr; - StatusWithMatchExpression expr = MatchExpressionParser::parse(queryObj, collator); + boost::intrusive_ptr<ExpressionContextForTest> expCtx(new ExpressionContextForTest()); + StatusWithMatchExpression expr = MatchExpressionParser::parse(queryObj, expCtx); ASSERT_OK(expr.getStatus()); std::unique_ptr<MatchExpression> rewrittenExpr = SubplanStage::rewriteToRootedOr(std::move(expr.getValue())); diff --git a/src/mongo/dbtests/query_stage_tests.cpp b/src/mongo/dbtests/query_stage_tests.cpp index 6b7893798e5..8f6e5a52373 100644 --- a/src/mongo/dbtests/query_stage_tests.cpp +++ b/src/mongo/dbtests/query_stage_tests.cpp @@ -82,8 +82,10 @@ public: AutoGetCollectionForReadCommand ctx(&_opCtx, NamespaceString(ns())); const CollatorInterface* collator = nullptr; + const boost::intrusive_ptr<ExpressionContext> expCtx( + new ExpressionContext(&_opCtx, collator)); StatusWithMatchExpression statusWithMatcher = - MatchExpressionParser::parse(filterObj, collator); + MatchExpressionParser::parse(filterObj, expCtx); verify(statusWithMatcher.isOK()); unique_ptr<MatchExpression> filterExpr = std::move(statusWithMatcher.getValue()); diff --git a/src/mongo/dbtests/query_stage_update.cpp b/src/mongo/dbtests/query_stage_update.cpp index 7ccd6058545..d53d3a2daf4 100644 --- a/src/mongo/dbtests/query_stage_update.cpp +++ b/src/mongo/dbtests/query_stage_update.cpp @@ -189,7 +189,8 @@ public: OldClientWriteContext ctx(&_opCtx, nss.ns()); CurOp& curOp = *CurOp::get(_opCtx); OpDebug* opDebug = &curOp.debug(); - UpdateDriver driver((UpdateDriver::Options())); + const CollatorInterface* collator = nullptr; + UpdateDriver driver((UpdateDriver::Options(new ExpressionContext(&_opCtx, collator)))); Collection* collection = ctx.getCollection(); // Collection should be empty. @@ -259,7 +260,8 @@ public: CurOp& curOp = *CurOp::get(_opCtx); OpDebug* opDebug = &curOp.debug(); - UpdateDriver driver((UpdateDriver::Options())); + const CollatorInterface* collator = nullptr; + UpdateDriver driver((UpdateDriver::Options(new ExpressionContext(&_opCtx, collator)))); Database* db = ctx.db(); Collection* coll = db->getCollection(&_opCtx, nss); @@ -377,7 +379,8 @@ public: Collection* coll = ctx.getCollection(); UpdateLifecycleImpl updateLifecycle(nss); UpdateRequest request(nss); - UpdateDriver driver((UpdateDriver::Options())); + const CollatorInterface* collator = nullptr; + UpdateDriver driver((UpdateDriver::Options(new ExpressionContext(&_opCtx, collator)))); const int targetDocIndex = 0; // We'll be working with the first doc in the collection. const BSONObj query = BSON("foo" << BSON("$gte" << targetDocIndex)); const auto ws = make_unique<WorkingSet>(); @@ -467,7 +470,8 @@ public: Collection* coll = ctx.getCollection(); UpdateLifecycleImpl updateLifecycle(nss); UpdateRequest request(nss); - UpdateDriver driver((UpdateDriver::Options())); + const CollatorInterface* collator = nullptr; + UpdateDriver driver((UpdateDriver::Options(new ExpressionContext(&_opCtx, collator)))); const int targetDocIndex = 10; const BSONObj query = BSON("foo" << BSON("$gte" << targetDocIndex)); const auto ws = make_unique<WorkingSet>(); @@ -553,7 +557,8 @@ public: Collection* coll = ctx.getCollection(); UpdateLifecycleImpl updateLifecycle(nss); UpdateRequest request(nss); - UpdateDriver driver((UpdateDriver::Options())); + const CollatorInterface* collator = nullptr; + UpdateDriver driver((UpdateDriver::Options(new ExpressionContext(&_opCtx, collator)))); const BSONObj query = BSONObj(); const auto ws = make_unique<WorkingSet>(); const unique_ptr<CanonicalQuery> cq(canonicalize(query)); |