35 #include "mongo/bson/simple_bsonobj_comparator.h" 36 #include "mongo/db/jsobj.h" 37 #include "mongo/db/record_id.h" 55 return SimpleBSONObjComparator::kInstance.evaluate(lhs.
key == rhs.
key) && (lhs.
loc == rhs.
loc);
187 bool prefixExclusive,
188 const std::vector<const BSONElement*>& keySuffix,
189 const std::vector<bool>& suffixInclusive,
190 const int cursorDirection);
bool prefixExclusive
If true, compare exclusively on just the fields on keyPrefix and ignore the suffix.
Definition: index_entry_comparison.h:115
const Ordering _order
Definition: index_entry_comparison.h:203
bool operator==(const IndexKeyEntry &lhs, const IndexKeyEntry &rhs)
Definition: index_entry_comparison.h:54
Copyright (C) 2014 MongoDB Inc.
Definition: bson_collection_catalog_entry.cpp:38
int compare(const IndexKeyEntry &lhs, const IndexKeyEntry &rhs) const
Compares two IndexKeyEntries and returns -1 if lhs < rhs, 1 if lhs > rhs, and 0 otherwise.
Definition: index_entry_comparison.cpp:60
static BSONObj makeQueryObject(const IndexSeekPoint &seekPoint, bool isForward)
Definition: index_entry_comparison.h:192
bool operator!=(const IndexKeyEntry &lhs, const IndexKeyEntry &rhs)
Definition: index_entry_comparison.h:58
BSONObj key
Definition: index_entry_comparison.h:48
bool operator()(const IndexKeyEntry &lhs, const IndexKeyEntry &rhs) const
Definition: index_entry_comparison.cpp:51
Compares two different IndexKeyEntry instances.
Definition: index_entry_comparison.h:140
IndexKeyEntry(BSONObj key, RecordId loc)
Definition: index_entry_comparison.h:46
std::ostream & operator<<(std::ostream &stream, const IndexKeyEntry &entry)
Definition: index_entry_comparison.cpp:37
int prefixLen
Use this many fields in 'keyPrefix'.
Definition: index_entry_comparison.h:110
std::vector< bool > suffixInclusive
If the ith element is false, ignore indexes > i in keySuffix and treat the concatenated key as exclus...
Definition: index_entry_comparison.h:130
RecordId loc
Definition: index_entry_comparison.h:49
IndexEntryComparison(Ordering order)
Definition: index_entry_comparison.h:142
BSONObj keyPrefix
Definition: index_entry_comparison.h:105
Describes a query that can be compared against an IndexKeyEntry in a way that allows expressing exclu...
Definition: index_entry_comparison.h:104
Represents a single item in an index.
Definition: index_entry_comparison.h:45
static BSONObj makeQueryObject(const BSONObj &keyPrefix, int prefixLen, bool prefixExclusive, const std::vector< const BSONElement * > &keySuffix, const std::vector< bool > &suffixInclusive, const int cursorDirection)
Encodes the arguments into a query object suitable to pass in to compare().
Definition: index_entry_comparison.cpp:111
std::vector< const BSONElement * > keySuffix
Elements starting at index 'prefixLen' are logically appended to the prefix.
Definition: index_entry_comparison.h:121