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

libbson JSON parser interprets $type as legacy binary

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

      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).

            Assignee:
            Unassigned Unassigned
            Reporter:
            kevin.albertson@mongodb.com Kevin Albertson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: