-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Server Programmability
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
Calling BSONObj::removeField, for example, on a BSONObj that has a nondefault maximum size trait will fail if, after removing the field in question, the resulting BSONObj will exceed the default maximum because the new BSONObj will not inherit the maximum size trait from its parent. Similarly, a BSONObj constructed as a copy of another BSONObj will not inherit traits from the original.
Without support for trait inheritance, callers that need to work with BSONObjs that use nondefault traits have to define subclasses that patch the behavior of the BSONObj API to correctly fit their uses. We should endeavor to eliminate the need to subclass from BSONObj for this reason.