summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/index_bounds_builder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/index_bounds_builder.cpp')
-rw-r--r--src/mongo/db/query/index_bounds_builder.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mongo/db/query/index_bounds_builder.cpp b/src/mongo/db/query/index_bounds_builder.cpp
index 38d53bb1bf9..cf94e16822c 100644
--- a/src/mongo/db/query/index_bounds_builder.cpp
+++ b/src/mongo/db/query/index_bounds_builder.cpp
@@ -249,6 +249,14 @@ bool typeMatch(const BSONObj& obj) {
return first.canonicalType() == second.canonicalType();
}
+bool IndexBoundsBuilder::canUseCoveredMatching(const MatchExpression* expr,
+ const IndexEntry& index) {
+ IndexBoundsBuilder::BoundsTightness tightness;
+ OrderedIntervalList oil;
+ translate(expr, BSONElement{}, index, &oil, &tightness);
+ return tightness >= IndexBoundsBuilder::INEXACT_COVERED;
+}
+
// static
void IndexBoundsBuilder::translate(const MatchExpression* expr,
const BSONElement& elt,