diff options
author | Tess Avitabile <tess.avitabile@mongodb.com> | 2017-01-11 17:14:40 -0500 |
---|---|---|
committer | Tess Avitabile <tess.avitabile@mongodb.com> | 2017-01-13 17:56:02 -0500 |
commit | 92e599237444912607e70a745fe5c0aa00dd4caf (patch) | |
tree | 3241f19d67635438a2ceb142d0584d0bb38b5bce /src/mongo/db/views/resolved_view.cpp | |
parent | 5c2aac3b24d0680418ee8fab1fa6e53be2a0eede (diff) | |
download | mongo-92e599237444912607e70a745fe5c0aa00dd4caf.tar.gz |
SERVER-24623 Remove single document aggregation result option
Diffstat (limited to 'src/mongo/db/views/resolved_view.cpp')
-rw-r--r-- | src/mongo/db/views/resolved_view.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/src/mongo/db/views/resolved_view.cpp b/src/mongo/db/views/resolved_view.cpp index d5f4faa7f68..c5d955a08d1 100644 --- a/src/mongo/db/views/resolved_view.cpp +++ b/src/mongo/db/views/resolved_view.cpp @@ -83,17 +83,12 @@ StatusWith<BSONObj> ResolvedView::asExpandedViewAggregation( } pipelineBuilder.doneFast(); - // The cursor option is always specified regardless of the presence of batchSize. - if (request.getBatchSize()) { - BSONObjBuilder batchSizeBuilder(aggregationBuilder.subobjStart("cursor")); - batchSizeBuilder.append(AggregationRequest::kBatchSizeName, *request.getBatchSize()); - batchSizeBuilder.doneFast(); - } else { - aggregationBuilder.append("cursor", BSONObj()); - } - if (request.isExplain()) { aggregationBuilder.append("explain", true); + } else { + BSONObjBuilder batchSizeBuilder(aggregationBuilder.subobjStart("cursor")); + batchSizeBuilder.append(AggregationRequest::kBatchSizeName, request.getBatchSize()); + batchSizeBuilder.doneFast(); } if (request.shouldBypassDocumentValidation()) { |