summaryrefslogtreecommitdiff
path: root/src/mongo/db/index_names.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/index_names.h')
-rw-r--r--src/mongo/db/index_names.h22
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