diff options
author | James Wahlin <james.wahlin@10gen.com> | 2016-09-23 11:28:21 -0400 |
---|---|---|
committer | James Wahlin <james.wahlin@10gen.com> | 2016-09-23 17:21:37 -0400 |
commit | 5563428f99af20c29cb334f97e84f0dcc1cb102a (patch) | |
tree | aad314cbc290ff98b2407c801c8a5a71234dda05 /src/mongo/db/index | |
parent | 2009fc942491098a4bd17001a2278af471e3cb08 (diff) | |
download | mongo-5563428f99af20c29cb334f97e84f0dcc1cb102a.tar.gz |
SERVER-769 Validate createIndexes field names
Diffstat (limited to 'src/mongo/db/index')
-rw-r--r-- | src/mongo/db/index/index_descriptor.cpp | 11 | ||||
-rw-r--r-- | src/mongo/db/index/index_descriptor.h | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/mongo/db/index/index_descriptor.cpp b/src/mongo/db/index/index_descriptor.cpp index fca84057727..ff7b615dd0b 100644 --- a/src/mongo/db/index/index_descriptor.cpp +++ b/src/mongo/db/index/index_descriptor.cpp @@ -70,18 +70,29 @@ void populateOptionsMap(std::map<StringData, BSONElement>& theMap, const BSONObj } } // namespace +constexpr StringData IndexDescriptor::k2dIndexBitsFieldName; +constexpr StringData IndexDescriptor::k2dIndexMaxFieldName; +constexpr StringData IndexDescriptor::k2dIndexMinFieldName; +constexpr StringData IndexDescriptor::k2dsphereCoarsestIndexedLevel; +constexpr StringData IndexDescriptor::k2dsphereFinestIndexedLevel; constexpr StringData IndexDescriptor::k2dsphereVersionFieldName; constexpr StringData IndexDescriptor::kBackgroundFieldName; constexpr StringData IndexDescriptor::kCollationFieldName; +constexpr StringData IndexDescriptor::kDefaultLanguageFieldName; constexpr StringData IndexDescriptor::kDropDuplicatesFieldName; +constexpr StringData IndexDescriptor::kExpireAfterSecondsFieldName; +constexpr StringData IndexDescriptor::kGeoHaystackBucketSize; constexpr StringData IndexDescriptor::kIndexNameFieldName; constexpr StringData IndexDescriptor::kIndexVersionFieldName; constexpr StringData IndexDescriptor::kKeyPatternFieldName; +constexpr StringData IndexDescriptor::kLanguageOverrideFieldName; constexpr StringData IndexDescriptor::kNamespaceFieldName; constexpr StringData IndexDescriptor::kPartialFilterExprFieldName; constexpr StringData IndexDescriptor::kSparseFieldName; +constexpr StringData IndexDescriptor::kStorageEngineFieldName; constexpr StringData IndexDescriptor::kTextVersionFieldName; constexpr StringData IndexDescriptor::kUniqueFieldName; +constexpr StringData IndexDescriptor::kWeightsFieldName; bool IndexDescriptor::isIndexVersionSupported(IndexVersion indexVersion) { switch (indexVersion) { diff --git a/src/mongo/db/index/index_descriptor.h b/src/mongo/db/index/index_descriptor.h index d271e7e5f5a..82ee02766de 100644 --- a/src/mongo/db/index/index_descriptor.h +++ b/src/mongo/db/index/index_descriptor.h @@ -56,18 +56,29 @@ class IndexDescriptor { public: enum class IndexVersion { kV0 = 0, kV1 = 1, kV2 = 2 }; + static constexpr StringData k2dIndexBitsFieldName = "bits"_sd; + static constexpr StringData k2dIndexMinFieldName = "min"_sd; + static constexpr StringData k2dIndexMaxFieldName = "max"_sd; + static constexpr StringData k2dsphereCoarsestIndexedLevel = "coarsestIndexedLevel"_sd; + static constexpr StringData k2dsphereFinestIndexedLevel = "finestIndexedLevel"_sd; static constexpr StringData k2dsphereVersionFieldName = "2dsphereIndexVersion"_sd; static constexpr StringData kBackgroundFieldName = "background"_sd; static constexpr StringData kCollationFieldName = "collation"_sd; + static constexpr StringData kDefaultLanguageFieldName = "default_language"_sd; static constexpr StringData kDropDuplicatesFieldName = "dropDups"_sd; + static constexpr StringData kExpireAfterSecondsFieldName = "expireAfterSeconds"_sd; + static constexpr StringData kGeoHaystackBucketSize = "bucketSize"_sd; static constexpr StringData kIndexNameFieldName = "name"_sd; static constexpr StringData kIndexVersionFieldName = "v"_sd; static constexpr StringData kKeyPatternFieldName = "key"_sd; + static constexpr StringData kLanguageOverrideFieldName = "language_override"_sd; static constexpr StringData kNamespaceFieldName = "ns"_sd; static constexpr StringData kPartialFilterExprFieldName = "partialFilterExpression"_sd; static constexpr StringData kSparseFieldName = "sparse"_sd; + static constexpr StringData kStorageEngineFieldName = "storageEngine"_sd; static constexpr StringData kTextVersionFieldName = "textIndexVersion"_sd; static constexpr StringData kUniqueFieldName = "unique"_sd; + static constexpr StringData kWeightsFieldName = "weights"_sd; /** * OnDiskIndexData is a pointer to the memory mapped per-index data. |