Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-3387

libbson JSON parser interprets $type as legacy binary

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major - P3
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: json, libbson
    • Labels:
      None

      Description

      The Extended JSON spec says:

      A parser that accepts Legacy Extended JSON MUST be configurable such that a JSON text of a MongoDB query filter containing the type query operator can be parsed, e.g.:

      { "zipCode" : { $type : 2 } }
      or:

      { "zipCode" : { $type : "string" } }

      But libbson returns an error when parsing a $type in any of the JSON parsing functions:

      • bson_json_reader_read
      • bson_init_from_json
      • bson_new_from_json

      Though it does accept the legacy binary format, e.g.

      { "$binary": "AQIDBAU=", "$type": "80" }
      

      I see no way to configure parsing to interpret $type as just a normal key (not a legacy binary type).

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kevin.albertson Kevin Albertson
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: