diff options
author | James Wahlin <james.wahlin@10gen.com> | 2017-01-24 16:48:31 -0500 |
---|---|---|
committer | James Wahlin <james.wahlin@10gen.com> | 2017-02-03 08:26:50 -0500 |
commit | 529adf30a88770c44b8dea31323f114975dfd78b (patch) | |
tree | dc18ec945b950a410d7e9d235b3de67587af6d34 /src/mongo/db/pipeline/aggregation_request.h | |
parent | 47da0b53f9cd27aeec1d2822780784866269a47d (diff) | |
download | mongo-529adf30a88770c44b8dea31323f114975dfd78b.tar.gz |
SERVER-27848 Add index hint to aggregation and non-materialized views
Diffstat (limited to 'src/mongo/db/pipeline/aggregation_request.h')
-rw-r--r-- | src/mongo/db/pipeline/aggregation_request.h | 14 |
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; |