summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/catalog/clustered_collection_util.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mongo/db/catalog/clustered_collection_util.cpp b/src/mongo/db/catalog/clustered_collection_util.cpp
index 8380f1fb4d4..c79adca9054 100644
--- a/src/mongo/db/catalog/clustered_collection_util.cpp
+++ b/src/mongo/db/catalog/clustered_collection_util.cpp
@@ -136,6 +136,12 @@ bool matchesClusterKey(const BSONObj& keyPatternObj,
// Clustered key cannot be compound.
return false;
}
+
+ if (!keyPatternObj.firstElement().isNumber()) {
+ // Clustered index can't be of any special type.
+ return false;
+ }
+
return keyPatternObj.firstElement().fieldNameStringData() ==
collInfo->getIndexSpec().getKey().firstElement().fieldNameStringData();
}