diff --git a/lib/helpers/query/cast$expr.js b/lib/helpers/query/cast$expr.js index 677e77f65f7..f7c7fe0521f 100644 --- a/lib/helpers/query/cast$expr.js +++ b/lib/helpers/query/cast$expr.js @@ -77,8 +77,8 @@ module.exports = function cast$expr(val, schema, strictQuery) { }; function _castExpression(val, schema, strictQuery) { - if (isPath(val)) { - // Assume path + // Preserve the value if it represents a path or if it's null + if (isPath(val) || val === null) { return val; }