Q function

UnresolvedExpr Q(
  1. String field,
  2. dynamic value
)

Helper function to construct an UnresolvedExpr filter node — Django's Q() object.

Supports lookup suffixes such as __gte, __lte, __icontains, __in, __isnull, __ne, etc.

Example:

final expr = Q('age__gte', 18) & Q('is_active', true);
final inExpr = Q('status__in', ['pending', 'approved']);

Implementation

UnresolvedExpr Q(String field, dynamic value) {
  return UnresolvedExpr.compare(field, BloomValue.from(value));
}