From 4dc41d135737dbda0a9ecc70af75687dd5df9099 Mon Sep 17 00:00:00 2001 From: Judah Schvimer Date: Thu, 15 Sep 2016 10:20:59 -0400 Subject: SERVER-26033 Allow simple range to exclude start key --- src/mongo/db/dbhelpers.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mongo/db/dbhelpers.cpp') diff --git a/src/mongo/db/dbhelpers.cpp b/src/mongo/db/dbhelpers.cpp index 53e73c11119..82fb612ddf8 100644 --- a/src/mongo/db/dbhelpers.cpp +++ b/src/mongo/db/dbhelpers.cpp @@ -295,7 +295,7 @@ BSONObj Helpers::inferKeyPattern(const BSONObj& o) { long long Helpers::removeRange(OperationContext* txn, const KeyRange& range, - bool maxInclusive, + BoundInclusion boundInclusion, const WriteConcernOptions& writeConcern, RemoveSaver* callback, bool fromMigrate, @@ -337,10 +337,12 @@ long long Helpers::removeRange(OperationContext* txn, // Extend bounds to match the index we found + invariant(IndexBounds::isStartIncludedInBound(boundInclusion)); // Extend min to get (min, MinKey, MinKey, ....) min = Helpers::toKeyFormat(indexKeyPattern.extendRangeBound(range.minKey, false)); // If upper bound is included, extend max to get (max, MaxKey, MaxKey, ...) // If not included, extend max to get (max, MinKey, MinKey, ....) + const bool maxInclusive = IndexBounds::isEndIncludedInBound(boundInclusion); max = Helpers::toKeyFormat(indexKeyPattern.extendRangeBound(range.maxKey, maxInclusive)); } @@ -369,7 +371,7 @@ long long Helpers::removeRange(OperationContext* txn, desc, min, max, - maxInclusive, + boundInclusion, PlanExecutor::YIELD_MANUAL, InternalPlanner::FORWARD, InternalPlanner::IXSCAN_FETCH)); -- cgit v1.2.1