Skip to content

Commit a9d58f6

Browse files
committed
fix: correctly parse 'not' expression arguments
1 parent 6e28d59 commit a9d58f6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/cloud_firestore/cloud_firestore_web/lib/src/pipeline_expression_parser_web.dart

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,9 @@ class PipelineExpressionParserWeb {
281281
}
282282
return result;
283283
case 'not':
284-
return _pipelines.not(_expr(argsMap, _kExpression));
284+
final expr = argsMap[_kExpression] as Map<String, dynamic>;
285+
final boolExpr = toBooleanExpression(expr) as JSAny;
286+
return _pipelines.not(boolExpr);
285287
case 'exists':
286288
return _pipelines.exists(_expr(argsMap, _kExpression));
287289
case 'is_absent':
@@ -336,7 +338,12 @@ class PipelineExpressionParserWeb {
336338
case 'filter':
337339
return _buildFilterExpression(argsMap);
338340
default:
339-
return null;
341+
throw FirebaseException(
342+
plugin: 'cloud_firestore',
343+
code: 'unsupported-boolean-expression',
344+
message: "The boolean expression '$name' is not supported on the web "
345+
'platform. The Firebase JS SDK may not expose this expression.',
346+
);
340347
}
341348
}
342349

0 commit comments

Comments
 (0)