summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/aggregation_request.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/aggregation_request.h')
-rw-r--r--src/mongo/db/pipeline/aggregation_request.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/aggregation_request.h b/src/mongo/db/pipeline/aggregation_request.h
index 4a3ef4c0223..b25eaa020dc 100644
--- a/src/mongo/db/pipeline/aggregation_request.h
+++ b/src/mongo/db/pipeline/aggregation_request.h
@@ -54,6 +54,7 @@ public:
static const StringData kCollationName;
static const StringData kExplainName;
static const StringData kAllowDiskUseName;
+ static const StringData kHintName;
static const long long kDefaultBatchSize;
@@ -119,6 +120,10 @@ public:
return _collation;
}
+ BSONObj getHint() const {
+ return _hint;
+ }
+
//
// Setters for optional fields.
//
@@ -135,6 +140,10 @@ public:
_collation = collation.getOwned();
}
+ void setHint(BSONObj hint) {
+ _hint = hint.getOwned();
+ }
+
void setExplain(bool isExplain) {
_explain = isExplain;
}
@@ -167,6 +176,11 @@ private:
// specified.
BSONObj _collation;
+ // The hint provided, if any. If the hint was by index key pattern, the value of '_hint' is
+ // the key pattern hinted. If the hint was by index name, the value of '_hint' is
+ // {$hint: <String>}, where <String> is the index name hinted.
+ BSONObj _hint;
+
bool _explain = false;
bool _allowDiskUse = false;
bool _fromRouter = false;