-
Type:
Improvement
-
Resolution: Fixed
-
Priority:
Trivial - P5
-
Affects Version/s: None
-
Component/s: Change streams
-
None
-
Query Execution
-
Fully Compatible
-
QE 2025-10-27
-
None
-
None
-
None
-
None
-
None
-
None
-
None
We can slightly optimize field lookups for change streams in the ChangeStreamUnwindTransactionStage.
In TransactionOpIterator::_assertExpectedTransactionEventFormat(), we should not use ValueComparator::kInstance.evaluate(), but compare the string value returned by getStringData() against a StringData constant.
Additionally, we can optimize away the lookup of the o field here in case the operation is not a command. We can instead add an early exit for this case, without looking up the o field at all.