summaryrefslogtreecommitdiff
path: root/db/btreecursor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'db/btreecursor.cpp')
-rw-r--r--db/btreecursor.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/db/btreecursor.cpp b/db/btreecursor.cpp
index bb477d6..ab15c44 100644
--- a/db/btreecursor.cpp
+++ b/db/btreecursor.cpp
@@ -36,7 +36,8 @@ namespace mongo {
indexDetails( _id ),
order( _id.keyPattern() ),
direction( _direction ),
- boundIndex_()
+ boundIndex_(),
+ _spec( _id.getSpec() )
{
audit();
init();
@@ -51,7 +52,8 @@ namespace mongo {
order( _id.keyPattern() ),
direction( _direction ),
bounds_( _bounds ),
- boundIndex_()
+ boundIndex_(),
+ _spec( _id.getSpec() )
{
assert( !bounds_.empty() );
audit();
@@ -74,6 +76,10 @@ namespace mongo {
}
void BtreeCursor::init() {
+ if ( _spec.getType() ){
+ startKey = _spec.getType()->fixKey( startKey );
+ endKey = _spec.getType()->fixKey( endKey );
+ }
bool found;
bucket = indexDetails.head.btree()->
locate(indexDetails, indexDetails.head, startKey, order, keyOfs, found, direction > 0 ? minDiskLoc : maxDiskLoc, direction);
@@ -88,7 +94,7 @@ namespace mongo {
init();
} while ( !ok() && ++boundIndex_ < bounds_.size() );
}
-
+
/* skip unused keys. */
void BtreeCursor::skipUnusedKeys() {
int u = 0;