summaryrefslogtreecommitdiff
path: root/src/mongo/db/index_legacy.cpp
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2013-10-30 10:04:29 -0400
committerEliot Horowitz <eliot@10gen.com>2013-11-02 13:19:54 -0400
commitc83e2593e8ad68bd2ad09eaaa4e28df34d0da068 (patch)
tree95b501e03fb5adfb94a16b62a2eecdafdf6c3a46 /src/mongo/db/index_legacy.cpp
parent8bc2fd8c35414b99017068e68c505a2a1b14a2b2 (diff)
downloadmongo-c83e2593e8ad68bd2ad09eaaa4e28df34d0da068.tar.gz
SERVER-11178: IndexLegacy::getMissingField using IndexCatalog
Diffstat (limited to 'src/mongo/db/index_legacy.cpp')
-rw-r--r--src/mongo/db/index_legacy.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/mongo/db/index_legacy.cpp b/src/mongo/db/index_legacy.cpp
index d76a0de8aa7..ef98839c29c 100644
--- a/src/mongo/db/index_legacy.cpp
+++ b/src/mongo/db/index_legacy.cpp
@@ -58,8 +58,15 @@ namespace mongo {
}
// static
- BSONObj IndexLegacy::getMissingField(const BSONObj& infoObj) {
- if (IndexNames::HASHED == CatalogHack::getAccessMethodName(infoObj.getObjectField("key"))) {
+ BSONObj IndexLegacy::getMissingField(Collection* collection, const BSONObj& infoObj) {
+ BSONObj keyPattern = infoObj.getObjectField( "key" );
+ string accessMethodName;
+ if ( collection )
+ accessMethodName = collection->getIndexCatalog()->getAccessMethodName(keyPattern);
+ else
+ accessMethodName = IndexNames::findPluginName(keyPattern);
+
+ if (IndexNames::HASHED == accessMethodName ) {
int hashVersion = infoObj["hashVersion"].numberInt();
HashSeed seed = infoObj["seed"].numberInt();