summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/change_stream_helpers_legacy.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/pipeline/change_stream_helpers_legacy.h')
-rw-r--r--src/mongo/db/pipeline/change_stream_helpers_legacy.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/change_stream_helpers_legacy.h b/src/mongo/db/pipeline/change_stream_helpers_legacy.h
index fff3b770134..e2e17843b49 100644
--- a/src/mongo/db/pipeline/change_stream_helpers_legacy.h
+++ b/src/mongo/db/pipeline/change_stream_helpers_legacy.h
@@ -66,4 +66,19 @@ static const std::set<StringData> kClassicOperationTypes =
DocumentSourceChangeStream::kReshardDoneCatchUpOpType,
DocumentSourceChangeStream::kNewShardDetectedOpType};
+/**
+ * Adds filtering for legacy-format {op: 'n'} oplog messages, which used the "o2.type" field to
+ * indicate the message type.
+ */
+void populateInternalOperationFilter(const boost::intrusive_ptr<ExpressionContext>& expCtx,
+ BSONArrayBuilder* filter);
+
+/**
+ * Converts legacy-format oplog o2 fields of type {type: <op name>, ...} to
+ * {..., <op name>: <namespace>}. Does nothing if the 'type' field is not present inside 'o2'.
+ */
+Document convertFromLegacyOplogFormat(const Document& legacyO2Entry, const NamespaceString& nss);
+
+StringData getNewShardDetectedOpName(const boost::intrusive_ptr<ExpressionContext>& expCtx);
+
} // namespace mongo::change_stream_legacy