diff --git a/src/mongo/db/pipeline/group_processor_base.h b/src/mongo/db/pipeline/group_processor_base.h index a868dc16727..f2bfa1d8d23 100644 --- a/src/mongo/db/pipeline/group_processor_base.h +++ b/src/mongo/db/pipeline/group_processor_base.h @@ -132,6 +132,7 @@ public: * Should not be used once execution has begun. */ std::vector>& getMutableIdExpressions() { + tassert(7020503, "Can't mutate _id fields after initialization", !_executionStarted); return _idExpressions; } @@ -147,6 +148,8 @@ public: * Should not be used once execution has begun. */ std::vector& getMutableAccumulationStatements() { + tassert( + 7020504, "Can't mutate accumulated fields after initialization", !_executionStarted); return _accumulatedFields; }