summaryrefslogtreecommitdiff
path: root/db/btreecursor.cpp
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2009-02-20 11:08:22 -0500
committerAaron <aaron@10gen.com>2009-02-20 11:08:22 -0500
commitdb0f38e88bf5e3d7391c233a9b4dec418355faaa (patch)
treee7cfd3acf4bd27a200accfd0f2eed83e03005249 /db/btreecursor.cpp
parent7939f06889f5354943f274d2ece0a94d072138d9 (diff)
downloadmongo-db0f38e88bf5e3d7391c233a9b4dec418355faaa.tar.gz
Dummy count implementation
Diffstat (limited to 'db/btreecursor.cpp')
-rw-r--r--db/btreecursor.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/db/btreecursor.cpp b/db/btreecursor.cpp
index 614b1313cbd..a6a0ad9a41a 100644
--- a/db/btreecursor.cpp
+++ b/db/btreecursor.cpp
@@ -61,6 +61,32 @@ namespace mongo {
checkEnd();
}
+ BtreeCursor::BtreeCursor( IndexDetails &_id, const BSONObj &_startKey, const BSONObj &_endKey, int _direction ) :
+ startKey( _startKey ),
+ endKey( _endKey ),
+ indexDetails( _id ),
+ order( _id.keyPattern() ),
+ direction( _direction ) {
+ bool found;
+ if ( otherTraceLevel >= 12 ) {
+ if ( otherTraceLevel >= 200 ) {
+ out() << "::BtreeCursor() qtl>200. validating entire index." << endl;
+ indexDetails.head.btree()->fullValidate(indexDetails.head, order);
+ }
+ else {
+ out() << "BTreeCursor(). dumping head bucket" << endl;
+ indexDetails.head.btree()->dump();
+ }
+ }
+
+ bucket = indexDetails.head.btree()->
+ locate(indexDetails, indexDetails.head, startKey, order, keyOfs, found, direction > 0 ? minDiskLoc : maxDiskLoc, direction);
+
+ skipUnusedKeys();
+
+ checkEnd();
+ }
+
string BtreeCursor::simpleRegexEnd( string regex ) {
++regex[ regex.length() - 1 ];
return regex;