-
Type: Bug
-
Resolution: Gone away
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
ALL
The syntax of $const is different from many other operators: it does not interpret an array as a list of arguments. {$const: [123]} evaluates to a 1-element array, while {$const: 123} evaluates to a number.
The rule for $const in grammar.yy currently expects START_ARRAY and END_ARRAY, so it rejects {$const: 123}.
Also, $const should accept arbitrary BSON, as in {$const: {$x: 1}}. The rule for valueFieldname has no case for $x. Actually, this might be a lexer error; I'm not sure.