-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Change streams
-
None
-
Query Execution
-
Fully Compatible
-
QE 2025-05-26
-
None
-
3
-
TBD
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
0
The handling of "noop" oplog entries in change_stream_event_transform.cpp is mostly similar for the different noop events that are currently handled by the transformer.
All of them set an operationType based on the field name found in the o2 field, and most of them copy the o2 field's content minus the matched field into operationDescription.
For a few types, the reshardingUUID field is added to the result, and for endOfTransaction we also add transaction-id specific fields.
Most of the above can be generalized so that we use a set of predefined field names and perform the transform like this:
eventNames = { "shardCollection", "migrateLastChunkFromShard", "refineCollectionShardKey", ... }; auto handle = [&]() { for (auto eventName : eventNames) { if (!o2Field[eventName].missing()) { operationType = eventName; operationDescription = Value(copyDocExceptFields(o2Field, {eventName})); return true; } } return false; }