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.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/mongo/db/pipeline/document_source_redact.cpp b/src/mongo/db/pipeline/document_source_redact.cpp
index 80dc406c620..c14651b55c7 100644
--- a/src/mongo/db/pipeline/document_source_redact.cpp
+++ b/src/mongo/db/pipeline/document_source_redact.cpp
@@ -143,8 +143,11 @@ boost::optional<Document> DocumentSourceRedact::redactObject(const Document& roo
return boost::optional<Document>();
} else if (simpleValueCmp.evaluate(expressionResult == descendVal)) {
const Document in = variables.getDocument(_currentId, root);
+ in.loadIntoCache();
+
MutableDocument out;
out.copyMetaDataFrom(in);
+
FieldIterator fields(in);
while (fields.more()) {
const Document::FieldPair field(fields.next());
@@ -169,8 +172,8 @@ intrusive_ptr<DocumentSource> DocumentSourceRedact::optimize() {
return this;
}
-Value DocumentSourceRedact::serialize(boost::optional<ExplainOptions::Verbosity> explain) const {
- return Value(DOC(getSourceName() << _expression.get()->serialize(static_cast<bool>(explain))));
+Value DocumentSourceRedact::serialize(const SerializationOptions& opts) const {
+ return Value(DOC(getSourceName() << _expression.get()->serialize(opts)));
}
intrusive_ptr<DocumentSource> DocumentSourceRedact::createFromBson(