Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-103536

BSONObj forgets its own traits when it constructs new BSONObjs

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 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.

            Assignee:
            james.bronsted@mongodb.com James Bronsted
            Reporter:
            james.bronsted@mongodb.com James Bronsted
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: