summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/record_id_bound.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/record_id_bound.h')
-rw-r--r--src/mongo/db/query/record_id_bound.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mongo/db/query/record_id_bound.h b/src/mongo/db/query/record_id_bound.h
index 99400ae938d..d6a37617a4f 100644
--- a/src/mongo/db/query/record_id_bound.h
+++ b/src/mongo/db/query/record_id_bound.h
@@ -29,6 +29,7 @@
#pragma once
+#include <boost/operators.hpp>
#include <boost/optional.hpp>
#include <fmt/format.h>
#include <ostream>
@@ -44,7 +45,7 @@ namespace mongo {
/**
* A RecordId bound for a collection scan, with an optional BSON representation for pretty printing.
*/
-class RecordIdBound {
+class RecordIdBound : boost::totally_ordered<RecordIdBound> {
public:
RecordIdBound() = default;
@@ -81,6 +82,14 @@ public:
return _recordId.compare(rhs._recordId);
}
+ bool operator==(const RecordIdBound& rhs) const {
+ return compare(rhs) == 0;
+ }
+
+ bool operator<(const RecordIdBound& rhs) const {
+ return compare(rhs) < 0;
+ }
+
private:
RecordId _recordId;
boost::optional<BSONObj> _bson;