summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/query_request.cpp
diff options
context:
space:
mode:
authorBernard Gorman <bernard.gorman@mongodb.com>2017-03-05 16:00:47 +0000
committerBernard Gorman <bernard.gorman@mongodb.com>2017-03-15 08:51:47 +0000
commit1b98ea650d24ab1718bc1669729431ffaf066337 (patch)
treecca0ba7d8c25c7b29a9efb560bdbb4f1174f487c /src/mongo/db/query/query_request.cpp
parent4948241998903e628ea3c18204191e71ee4b3896 (diff)
downloadmongo-1b98ea650d24ab1718bc1669729431ffaf066337.tar.gz
SERVER-28128 Add support for a "comment" parameter to the aggregate...
... command
Diffstat (limited to 'src/mongo/db/query/query_request.cpp')
-rw-r--r--src/mongo/db/query/query_request.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mongo/db/query/query_request.cpp b/src/mongo/db/query/query_request.cpp
index dc8188ab96a..04c4154f741 100644
--- a/src/mongo/db/query/query_request.cpp
+++ b/src/mongo/db/query/query_request.cpp
@@ -964,10 +964,6 @@ StatusWith<BSONObj> QueryRequest::asAggregationCommand() const {
return {ErrorCodes::InvalidPipelineOperator,
str::stream() << "Option " << kReturnKeyField << " not supported in aggregation."};
}
- if (!_comment.empty()) {
- return {ErrorCodes::InvalidPipelineOperator,
- str::stream() << "Option " << kCommentField << " not supported in aggregation."};
- }
if (_showRecordId) {
return {ErrorCodes::InvalidPipelineOperator,
str::stream() << "Option " << kShowRecordIdField
@@ -1064,6 +1060,9 @@ StatusWith<BSONObj> QueryRequest::asAggregationCommand() const {
if (!_hint.isEmpty()) {
aggregationBuilder.append("hint", _hint);
}
+ if (!_comment.empty()) {
+ aggregationBuilder.append("comment", _comment);
+ }
return StatusWith<BSONObj>(aggregationBuilder.obj());
}
} // namespace mongo