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).
- related to
-
CXX-2488 CSFLE badQueries and types errorContains failing to match on mongocryptd 6.0.0-alpha
- Closed