-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Fully Compatible
-
Query 2020-08-24
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
Implement validation error generation for $exists, $type, $expr, $regex, and $mod along with unit tests verifying that generated errors conform to the expected format.
The error formats should conform to the formats outlined in the design document. In particular:
- $exists should append the operatorName and the annotation which captures how the operator was specified by the user.
- $expr should do the same as $exists, but additionally append the evaluation result (i.e. the boolean value that 'ExprMatchExpression::matches()' evaluates to).
- $type should behave similarly to comparison operators, but should also collect consideredType(s) (that is, the set of types observed at the given path within the document).
- $regex and $mod should behave similarly to the comparison operators.
Note that similarly, to the comparison operators, for any of these operators to be capable of generating errors, they need to be annotated at parse time with the information necessary to generate a sensible error (namely, the name of the operator and how the operator was specified by the user).