diff options
author | Hari Khalsa <hkhalsa@10gen.com> | 2013-04-29 12:17:05 -0400 |
---|---|---|
committer | Hari Khalsa <hkhalsa@10gen.com> | 2013-05-02 15:57:13 -0400 |
commit | 41a2d01e419cabd2011ce4ce7262eb8b7181d9e7 (patch) | |
tree | 0bf766b83bda0090a853ec8d48e6c2f75d605d97 /src/mongo/db/index_names.h | |
parent | fc76b559266c4e2aee0707e6d640c08d20ff9e55 (diff) | |
download | mongo-41a2d01e419cabd2011ce4ce7262eb8b7181d9e7.tar.gz |
SERVER-8791 SERVER-9212 retire indexplugin/indextype
Diffstat (limited to 'src/mongo/db/index_names.h')
-rw-r--r-- | src/mongo/db/index_names.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/mongo/db/index_names.h b/src/mongo/db/index_names.h index db16ab0067a..c2eef144ad9 100644 --- a/src/mongo/db/index_names.h +++ b/src/mongo/db/index_names.h @@ -34,6 +34,28 @@ namespace mongo { static const string TEXT; static const string TEXT_INTERNAL; static const string HASHED; + + /** + * True if is a regular (non-plugin) index or uses a plugin that existed before 2.4. + * These plugins are grandfathered in and allowed to exist in DBs with + * PDFILE_MINOR_VERSION_22_AND_OLDER + */ + static bool existedBefore24(const string& name) { + return name.empty() + || name == IndexNames::GEO_2D + || name == IndexNames::GEO_HAYSTACK + || name == IndexNames::HASHED; + } + + static bool isKnownName(const string& name) { + return name.empty() + || name == IndexNames::GEO_2D + || name == IndexNames::GEO_2DSPHERE + || name == IndexNames::GEO_HAYSTACK + || name == IndexNames::TEXT + || name == IndexNames::TEXT_INTERNAL + || name == IndexNames::HASHED; + } }; } // namespace mongo |