Uploaded image for project: 'Drivers'
  1. Drivers
  2. DRIVERS-1305

Clarify that dollar-prefixed fields not matching known types are left as-is during parsing

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Component/s: Extended JSON
    • None
    • Not Needed

      During a scope review for the "Mitigate pain of using field names with dots and dollars" server project, questions were raised about how the Extended JSON spec handles the case of parsing dollar-prefixed fields.

      The Parsers section of the spec states:

      When parsing a JSON object other than the top-level object, the presence of a $-prefixed key indicates the object could be a type wrapper object as described in the Extended JSON Conversion table. In such a case, the parser MUST follow these rules, unless configured to allow Legacy Extended JSON, in which case it SHOULD follow these rules

      It goes on to say that dollar-prefixed fields matching a known type shall be strictly validated against the structure defined in the spec; however, the spec does not address how dollar-prefixed fields not matching a known type code should be handled.

      In the interest of the server project, such fields should be left as-is. This is a first step to ensuring compatibility with the project, and can be addressed before a future ticket to introduce some syntax for escaping dots/dollars in extended JSON (which will ultimately allow conflicts with types like $numberLong to be avoided entirely).

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: