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

Ensure BSON nesting depth error messages refer to documented limit

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • Storage Execution

      Nested Depth for BSON Documents documents a fix limit of 100 with no mention of this being configurable. While this can be altered via the undocumented maxBSONDepth server parameter, henrik.edin clarified that it is mainly used for internal testing and the edge case of nested BSON (e.g. CodeWScope within a nesting level, where its scope has its own nesting).

      Quoting divjot.arora from the linked HELP ticket:

      As I mentioned in a previous comment, the fact that it was documented to be 100 almost caused us to make a mistake in a feature implementation. These limits are also mentioned in the error messages themselves. Testing on a 4.2.6 server, I got this error when using a 201-level filter for the find command: (Overflow) BSONObj exceeded maximum nested object depth: 200 and this error when inserting a 200-level document: cannot insert document because it exceeds 180 levels of nesting. As an aside, I wasn't aware that the limits are different for inserting vs finding.

      Either way, these limits are incorrectly documented and also included in our error messages. Leaving this as-is just seems confusing.

      The requested action in this ticket is to ensure that any error messages that may be exposed to users consistently refer to the documented limit of 100.

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: