summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/query_stage_near.cpp
diff options
context:
space:
mode:
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};