summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_cursor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/document_source_cursor.cpp')
-rw-r--r--src/mongo/db/pipeline/document_source_cursor.cpp14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/mongo/db/pipeline/document_source_cursor.cpp b/src/mongo/db/pipeline/document_source_cursor.cpp
index eb01db2a2ad..e1193e33cb8 100644
--- a/src/mongo/db/pipeline/document_source_cursor.cpp
+++ b/src/mongo/db/pipeline/document_source_cursor.cpp
@@ -73,13 +73,6 @@ DocumentSource::GetNextResult DocumentSourceCursor::doGetNext() {
return std::move(out);
}
-Document DocumentSourceCursor::transformBSONObjToDocument(const BSONObj& obj) const {
- // Aggregation assumes ownership of underlying BSON.
- return _dependencies ? _dependencies->extractFields(obj)
- : (_inputHasMetadata ? Document::fromBsonWithMetaData(obj.getOwned())
- : Document(obj.getOwned()));
-}
-
void DocumentSourceCursor::loadBatch() {
if (!_exec || _exec->isDisposed()) {
// No more documents.
@@ -92,7 +85,7 @@ void DocumentSourceCursor::loadBatch() {
}
PlanExecutor::ExecState state;
- BSONObj resultObj;
+ Document resultObj;
{
AutoGetCollectionForRead autoColl(pExpCtx->opCtx, _exec->nss());
uassertStatusOK(repl::ReplicationCoordinator::get(pExpCtx->opCtx)
@@ -108,7 +101,7 @@ void DocumentSourceCursor::loadBatch() {
if (_shouldProduceEmptyDocs) {
_currentBatch.push_back(Document());
} else {
- _currentBatch.push_back(transformBSONObjToDocument(resultObj));
+ _currentBatch.push_back(transformDoc(resultObj.getOwned()));
}
if (_limit) {
@@ -228,9 +221,6 @@ Value DocumentSourceCursor::serialize(boost::optional<ExplainOptions::Verbosity>
if (_limit)
out["limit"] = Value(_limit->getLimit());
- if (!_projection.isEmpty())
- out["fields"] = Value(_projection);
-
BSONObjBuilder explainStatsBuilder;
{