BugZero found this defect 24 days ago.
Data sources
All data on this page is proprietary to BugZero® or gathered from public sources
4/25/2024
MongoDB Server
No affected releases provided.
No fixed releases provided.
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.
pipeline = [{$match: {$jsonSchema: {required: ["a", "b", "$dollarPrefixes"]}}}] For the pipeline above, the "required" keyword parses into the following MatchExpression: [{ "$match": { "$or": [{[kHashedArrayName]: {"$eq": "?array"}}] },}]