summaryrefslogtreecommitdiff
path: root/src/mongo/db/views/resolved_view_test.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/views/resolved_view_test.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/views/resolved_view_test.cpp')
-rw-r--r--src/mongo/db/views/resolved_view_test.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/views/resolved_view_test.cpp b/src/mongo/db/views/resolved_view_test.cpp
index e25c5b263b7..cd34a8e6cf4 100644
--- a/src/mongo/db/views/resolved_view_test.cpp
+++ b/src/mongo/db/views/resolved_view_test.cpp
@@ -125,6 +125,15 @@ TEST(ResolvedViewTest, ExpandingAggRequestPreservesCollation) {
<< "fr_CA"));
}
+TEST(ResolvedViewTest, ExpandingAggRequestPreservesComment) {
+ const ResolvedView resolvedView{backingNss, emptyPipeline};
+ AggregationRequest aggRequest(viewNss, {});
+ aggRequest.setComment("agg_comment");
+
+ auto result = resolvedView.asExpandedViewAggregation(aggRequest);
+ ASSERT_EQ(result.getComment(), "agg_comment");
+}
+
TEST(ResolvedViewTest, FromBSONFailsIfMissingResolvedView) {
BSONObj badCmdResponse = BSON("x" << 1);
ASSERT_THROWS_CODE(ResolvedView::fromBSON(badCmdResponse), UserException, 40248);