Operational Defect Database

BugZero found this defect 24 days ago.

MongoDB | 2653829

Make $jsonSchema with dollar fields in all keyword fields reparseable

Last update date:

4/25/2024

Affected products:

MongoDB Server

Affected releases:

No affected releases provided.

Fixed releases:

No fixed releases provided.

Description:

Info

If $jsonSchema has a property with $[name], the match expression that it is parsed to is not proper bson and is unable to be reparsed, causing errors in query stats (and possibly situations beyond query stats, either now or in the future). As part of SERVER-86945, $jsonSchema commands with "properties" fields containing dollar-prefixed fieldpaths are now reparseable. However, the implementation relies on checking the root of the MatchExpression to see if contains a "$_internalSchema..." child expression, which is not guaranteed for all jsonSchema fields. To make all jsonSchema keywords reparseable, we need to find a way to mark parsed and translated jsonSchema expressions as originating from $jsonSchema. We can then skip dollar field validation for those expressions.

Top User Comments


Steps to Reproduce

pipeline = [{$match: {$jsonSchema: {required: ["a", "b", "$dollarPrefixes"]}}}] For the pipeline above, the "required" keyword parses into the following MatchExpression: [{ "$match": { "$or": [{[kHashedArrayName]: {"$eq": "?array"}}] },}]

Additional Resources / Links

Share:

BugZero® Risk Score

What's this?

Coming soon

Status

Open

Learn More

Search:

...