summaryrefslogtreecommitdiff
path: root/src/mongo/db/catalog/index_key_validate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/catalog/index_key_validate.cpp')
-rw-r--r--src/mongo/db/catalog/index_key_validate.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/mongo/db/catalog/index_key_validate.cpp b/src/mongo/db/catalog/index_key_validate.cpp
index caa209fd3c3..3a663298d5d 100644
--- a/src/mongo/db/catalog/index_key_validate.cpp
+++ b/src/mongo/db/catalog/index_key_validate.cpp
@@ -94,6 +94,7 @@ static std::set<StringData> allowedFieldNames = {
IndexDescriptor::kUniqueFieldName,
IndexDescriptor::kWeightsFieldName,
IndexDescriptor::kOriginalSpecFieldName,
+ IndexDescriptor::kDisallowNewDuplicateKeysFieldName,
// Index creation under legacy writeMode can result in an index spec with an _id field.
"_id"};
@@ -497,6 +498,7 @@ StatusWith<BSONObj> validateIndexSpec(OperationContext* opCtx, const BSONObj& in
IndexDescriptor::k2dsphereCoarsestIndexedLevel == indexSpecElemFieldName ||
IndexDescriptor::k2dsphereFinestIndexedLevel == indexSpecElemFieldName ||
IndexDescriptor::kDropDuplicatesFieldName == indexSpecElemFieldName ||
+ IndexDescriptor::kDisallowNewDuplicateKeysFieldName == indexSpecElemFieldName ||
"clustered" == indexSpecElemFieldName) &&
!indexSpecElem.isNumber() && !indexSpecElem.isBoolean()) {
return {ErrorCodes::TypeMismatch,