summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/query_solution.cpp
diff options
context:
space:
mode:
authorGreg Studer <greg@10gen.com>2014-08-27 13:35:30 -0400
committerGreg Studer <greg@10gen.com>2014-09-02 15:38:51 -0400
commit2f7fce0df9e48b804ff560bccd469e2fcad2325f (patch)
treea9f64dc7b255cd58d34b6494e6c09388575ced78 /src/mongo/db/query/query_solution.cpp
parent097039445a16436ee0e992b1613c7b0b6b269a2d (diff)
downloadmongo-2f7fce0df9e48b804ff560bccd469e2fcad2325f.tar.gz
SERVER-5022 allow covered queries with shard filter
Diffstat (limited to 'src/mongo/db/query/query_solution.cpp')
-rw-r--r--src/mongo/db/query/query_solution.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mongo/db/query/query_solution.cpp b/src/mongo/db/query/query_solution.cpp
index deee6cca95a..3e042cb2b7c 100644
--- a/src/mongo/db/query/query_solution.cpp
+++ b/src/mongo/db/query/query_solution.cpp
@@ -26,6 +26,7 @@
* it in the license file.
*/
+#include "mongo/db/index_names.h"
#include "mongo/db/query/query_solution.h"
#include "mongo/db/query/lite_parsed_query.h"
#include "mongo/db/matcher/expression_geo.h"
@@ -412,6 +413,10 @@ namespace mongo {
// in the key was extracted from an array in the original document.
if (indexIsMultiKey) { return false; }
+ // Custom index access methods may return non-exact key data - this function is currently
+ // used for covering exact key data only.
+ if (IndexNames::BTREE != IndexNames::findPluginName(indexKeyPattern)) { return false; }
+
BSONObjIterator it(indexKeyPattern);
while (it.more()) {
if (field == it.next().fieldName()) {