summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/query_stage_near.cpp
diff options
context:
space:
mode:
authorBernard Gorman <bernard.gorman@gmail.com>2020-02-27 17:31:30 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-04-25 20:23:43 +0000
commit085ffeb310e8fed49739cf8443fcb13ea795d867 (patch)
tree8c5c0b5681ece32c285cf65345f6c98f8f087f6c /src/mongo/dbtests/query_stage_near.cpp
parentb4fedf13f77347b4be11053b59d01f80b769fd7c (diff)
downloadmongo-085ffeb310e8fed49739cf8443fcb13ea795d867.tar.gz
SERVER-25023 Allow multiple indexes on the same fields with different partial index filters
Diffstat (limited to 'src/mongo/dbtests/query_stage_near.cpp')
-rw-r--r--src/mongo/dbtests/query_stage_near.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mongo/dbtests/query_stage_near.cpp b/src/mongo/dbtests/query_stage_near.cpp
index 938a98e2f88..2976c4cfeb1 100644
--- a/src/mongo/dbtests/query_stage_near.cpp
+++ b/src/mongo/dbtests/query_stage_near.cpp
@@ -69,12 +69,18 @@ public:
_autoColl.emplace(_opCtx, NamespaceString{kTestNamespace});
auto* coll = _autoColl->getCollection();
ASSERT(coll);
- _mockGeoIndex = coll->getIndexCatalog()->findIndexByKeyPatternAndCollationSpec(
- _opCtx, kTestKeyPattern, BSONObj{});
+ _mockGeoIndex = coll->getIndexCatalog()->findIndexByKeyPatternAndOptions(
+ _opCtx, kTestKeyPattern, _makeMinimalIndexSpec(kTestKeyPattern));
ASSERT(_mockGeoIndex);
}
protected:
+ BSONObj _makeMinimalIndexSpec(BSONObj keyPattern) {
+ return BSON(IndexDescriptor::kKeyPatternFieldName
+ << keyPattern << IndexDescriptor::kIndexVersionFieldName
+ << IndexDescriptor::getDefaultIndexVersion());
+ }
+
const ServiceContext::UniqueOperationContext _uniqOpCtx = cc().makeOperationContext();
OperationContext* const _opCtx = _uniqOpCtx.get();
DBDirectClient directClient{_opCtx};