whereContains function

CoffeeQueryFilter whereContains(
  1. dynamic type,
  2. String value
)

Creates a filter for containment searches.

type: The property to filter by, either a String or a Function. value: The string value that the property should contain.

Returns a CoffeeQueryFilter configured for containment searches.

Usage Example

whereContains('name', 'Espresso')
whereContains((Model model) => model.name, 'Latte')

Implementation

CoffeeQueryFilter whereContains(dynamic type, String value) {
  final propertyName = _getPropertyName(type);
  return CoffeeQueryFilter(
    expression: '$propertyName@=$value',
    type: 'filter',
  );
}