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.
1 parent cf0a815 commit 52d3655Copy full SHA for 52d3655
lib/helpers/query/cast$expr.js
@@ -69,7 +69,10 @@ const dateOperators = new Set([
69
const expressionOperator = new Set(['$not']);
70
71
module.exports = function cast$expr(val, schema, strictQuery) {
72
- if ((typeof val !== 'object' || val === null) && typeof val !== 'boolean') {
+ if (typeof val === 'boolean') {
73
+ return val;
74
+ }
75
+ if (typeof val !== 'object' || val === null) {
76
throw new Error('`$expr` must be an object or boolean literal');
77
}
78
0 commit comments