summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/document_source_redact.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/document_source_redact.cpp')
-rw-r--r--src/mongo/db/pipeline/document_source_redact.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/mongo/db/pipeline/document_source_redact.cpp b/src/mongo/db/pipeline/document_source_redact.cpp
index 4bd685a8382..9ad79eca661 100644
--- a/src/mongo/db/pipeline/document_source_redact.cpp
+++ b/src/mongo/db/pipeline/document_source_redact.cpp
@@ -84,10 +84,7 @@ Pipeline::SourceContainer::iterator DocumentSourceRedact::optimizeAt(
// create an infinite number of $matches.
Pipeline::SourceContainer::iterator returnItr = std::next(itr);
- container->insert(
- itr,
- DocumentSourceMatch::createFromBson(
- BSON("$match" << redactSafePortion).firstElement(), this->pExpCtx));
+ container->insert(itr, DocumentSourceMatch::create(redactSafePortion, pExpCtx));
return returnItr;
}