whereField method
void
whereField({
- required StrapiLeafField field,
- required StrapiFieldQuery query,
- required dynamic value,
used to filter against a field in strapi data structure in collection, field
should be a
leaf fields, which means it should be a basic data type supported by strapi like
Date, String, Number, bool etc
throws StrapiException if field isnt truw StrapiLeafField
Implementation
void whereField({
required StrapiLeafField field,
required StrapiFieldQuery query,
required value,
}) {
final v = StrapiField.processValue(value, query);
if (v is String) {
_where.add(field.fieldName + _operation(query) + ":$v");
} else {
throw StrapiException(
msg:
"leaf value must be a basic type or list of basic type incase of includes/notincludes in an array operation ${v.runtimeType}",
);
}
}