hasMatchAsMap method

bool hasMatchAsMap(
  1. DynamicMap? data
)

Pass filters through data and return true if all conditions are met.

datafiltersを通し、条件にすべて当てはまる場合trueを返します。

Implementation

bool hasMatchAsMap(DynamicMap? data) {
  if (data == null) {
    return false;
  }
  for (final filter in filters) {
    if (filter.type == ModelQueryFilterType.orderByAsc ||
        filter.type == ModelQueryFilterType.orderByDesc ||
        filter.type == ModelQueryFilterType.limit) {
      continue;
    }
    if (filter.key.isEmpty) {
      continue;
    }
    final val = data.containsKey(filter.key) ? data[filter.key] : null;
    if (!filter._hasMatchValue(val)) {
      return false;
    }
  }
  return true;
}