We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c054618 + 52d3655 commit 933c6b0Copy full SHA for 933c6b0
lib/helpers/query/cast$expr.js
@@ -69,8 +69,11 @@ const dateOperators = new Set([
69
const expressionOperator = new Set(['$not']);
70
71
module.exports = function cast$expr(val, schema, strictQuery) {
72
+ if (typeof val === 'boolean') {
73
+ return val;
74
+ }
75
if (typeof val !== 'object' || val === null) {
- throw new Error('`$expr` must be an object');
76
+ throw new Error('`$expr` must be an object or boolean literal');
77
}
78
79
return _castExpression(val, schema, strictQuery);
0 commit comments