summaryrefslogtreecommitdiff
path: root/db/queryutil.h
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2011-06-02 00:47:14 -0400
committerAaron <aaron@10gen.com>2011-06-02 10:23:32 -0400
commit70fbe10acfeb620022dd949a9ee9e90a3f683d32 (patch)
treee48d12ec96c8893b72aa775f291ac81000004dce /db/queryutil.h
parentd70079c7df7142cfc79b45e8f2297f514b3360ae (diff)
downloadmongo-70fbe10acfeb620022dd949a9ee9e90a3f683d32.tar.gz
SERVER-480 SERVER-2884 Perform in memory sorts by generating keys suitable for an index
Diffstat (limited to 'db/queryutil.h')
-rw-r--r--db/queryutil.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/db/queryutil.h b/db/queryutil.h
index 6445cf7b5fc..00d2d264961 100644
--- a/db/queryutil.h
+++ b/db/queryutil.h
@@ -313,9 +313,16 @@ namespace mongo {
*/
bool matches( const BSONObj &obj ) const;
+ /**
+ * @return first key of 'obj' that would be encountered by a forward
+ * index scan using this FieldRangeVector, BSONObj() if no such key.
+ */
+ BSONObj firstMatch( const BSONObj &obj ) const;
+
private:
int matchingLowElement( const BSONElement &e, int i, bool direction, bool &lowEquality ) const;
bool matchesElement( const BSONElement &e, int i, bool direction ) const;
+ bool matchesKey( const BSONObj &key ) const;
vector<FieldRange> _ranges;
const IndexSpec &_indexSpec;
int _direction;