summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/count_request_test.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/query/count_request_test.cpp')
-rw-r--r--src/mongo/db/query/count_request_test.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mongo/db/query/count_request_test.cpp b/src/mongo/db/query/count_request_test.cpp
index e2a40f87ccf..8508c75ead6 100644
--- a/src/mongo/db/query/count_request_test.cpp
+++ b/src/mongo/db/query/count_request_test.cpp
@@ -271,15 +271,17 @@ TEST(CountRequest, ConvertToAggregationWithQueryAndFilterAndLimit) {
SimpleBSONObjComparator::kInstance.makeEqualTo()));
}
-TEST(CountRequest, ConvertToAggregationWithExplain) {
+TEST(CountRequest, ConvertToAggregationOmitsExplain) {
CountRequest countRequest(testns, BSONObj());
countRequest.setExplain(true);
auto agg = countRequest.asAggregationCommand();
ASSERT_OK(agg);
+ ASSERT_FALSE(agg.getValue().hasField("explain"));
+
auto ar = AggregationRequest::parseFromBSON(testns, agg.getValue());
ASSERT_OK(ar.getStatus());
- ASSERT(ar.getValue().isExplain());
+ ASSERT_FALSE(ar.getValue().getExplain());
ASSERT_EQ(ar.getValue().getNamespaceString(), testns);
ASSERT_BSONOBJ_EQ(ar.getValue().getCollation(), BSONObj());