where function

CoffeeQueryFilter where(
  1. dynamic type,
  2. WhereOperator operator,
  3. dynamic value
)

Creates a filter for exact condition searches.

type: The property to filter by, either a String or a Function. operator: The operator to use in the filter (e.g., WhereOperator.equal, WhereOperator.greater, etc.). value: The value to compare the property against.

Returns a CoffeeQueryFilter configured for exact condition searches.

Usage Example

where('name', WhereOperator.equal, 'Espresso')
where((Model model) => model.age, WhereOperator.greater, 18)

Implementation

CoffeeQueryFilter where(dynamic type, WhereOperator operator, dynamic value) {
  final propertyName = _getPropertyName(type);
  final operatorStr = _whereOperatorToString(operator);
  return CoffeeQueryFilter(
    expression: '$propertyName$operatorStr$value',
    type: 'filter',
  );
}