0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-30 09:06:21 +01:00

Ignore index direction when bounding btree cursor, as btree doesn't yet support directional indexes.

This commit is contained in:
Aaron 2008-12-16 12:18:02 -05:00
parent 92a5ab8180
commit 6215e19014

View File

@ -65,8 +65,10 @@ void BtreeCursor::findExtremeKeys( const BSONObj &query ) {
for( set<string>::iterator i = fields.begin(); i != fields.end(); ++i ) {
const char * field = i->c_str();
BSONElement k = indexDetails.keyPattern().getFieldDotted( field );
int number = (int) k.number(); // returns 0.0 if not numeric
bool forward = ( ( number >= 0 ? 1 : -1 ) * direction > 0 );
// int number = (int) k.number(); // returns 0.0 if not numeric
// bool forward = ( ( number >= 0 ? 1 : -1 ) * direction > 0 );
// Temporary, until btree supports directional indexes.
bool forward = ( direction > 0 );
BSONElement lowest = minKey.firstElement();
BSONElement highest = maxKey.firstElement();
BSONElement e = query.getFieldDotted( field );